How to setup Open WebMail using SpeedyCGI

Written by Kevin L. Ellis


            This tutorial will show you how to setup Open WebMail (OWM) so that it uses SpeedyCGI (aka PersistentPerl) to increase the performance of OWM.  If you don't have suidperl and are running Slackware instructions for getting suidperl running are located here.  These instructions might also apply to other distros too with minor changes.  (Note: I only run Slackware systems, so please don't ask what to do with other distros because I am not familiar with them.

            There are two ways to do this, one is to configure your OWM installation so it uses SpeedyCGI instead of regular Perl and the other way is to install a second copy of OWM and configure it to use SpeedyCGI so you have both a regular Perl version and a SpeedyCGI version.  The second way will let you test OWM w/ SpeedyCGI and see what type of speedup you get.

1.    First, download SpeedyCGI and compile it with suid support.  From the SpeedyCGI mail list:

http://sourceforge.net/mailarchive/message.php?msg_id=1793594


To install the setuid speedy do the following:

- Run "perl Makefile.PL"

- Edit speedy/Makefile and add "-DIAMSUID" to the end of the "DEFINE = " line.

- Run make

- Take the resulting "speedy" binary and install it suid-root as /usr/bin/speedy_suidperl (chmod +s /usr/bin/speedy_suidperl)

- Change your setuid scripts to use /usr/bin/speedy_suidperl as the interpreter.


2.    If you want just modify your regular OWM installation skip to step 4.  This step and step 3 is to install a second copy of OWM to test SpeedyCGI with.

    Install a second copy of OWM in cgi-bin  using the directory name openwebmail.test  Configure the new OWM installation and make sure you point
ow_cgidir and ow_cgiurl to the cgi-bin/openwebmail.test  directory in openwebmail.conf


3.    In cgi-bin/openwebmail.test  run this bash script:

for name in *.pl ; do
   cp -a $name ${name}.old
   sed -e "s/openwebmail_path.conf/openwebmail_path.conf.test/" <  ${name}.old > ${name}
done 

    Create the file /etc/openwebmail_path.conf.test  and put in it the directory hierarchy to cgi-bin/openwebmail.test  


4.    In the cgi-bin directory for OWM (either openwebmail  or openwebmail.test) run this bash script:

for name in open*.pl ; do
   cp -a $name ${name}.old
   sed -e "s/suidperl/speedy_suidperl/" <  ${name}.old > ${name}
done

    This script changes the .pl files so they use speedy_suid instead of suidperl.



    That's all there is to getting OWM and SpeedyCGI working together.  
Point your web browser to OWM and try to login.  




Here are some speed tests I did to see what type of improvement I would get.


Action
Stock
SpeedyCGI
Speed-Up
Main page
1.209
0.826
1.5x
Login
2.139
0.432
5.0x
Compose button
1.876
0.501
3.7x
Folder button
1.487
0.441
3.4x
Pref button
2.564
1.601
1.6x
Refresh 10 new e-mails
2.883
1.335
2.2x
Move 10 e-mails to trash
1.807
0.456
4.0x
Delete 10 e-mails
1.808
0.461
3.9x
Open new e-mail w/ 10 in inbox
1.806
1.588
1.1x
Logout
1.564
0.279
5.6x


    The times were gathered using Mozilla 1.0, at the bottom of the browser window it reports the number of seconds for the page to come up.  I realize it's not the best measurement tool but it provided a quick test.  You don't even need the times, you can "feel" the speed up just using OWM w/ SpeedyCGI.



Last Modified: 1/30/06