Quoting Badai Aqrandista <[EMAIL PROTECTED]>: > > > > >Then how do you know what to write in C? > > > > I have localized one subroutine that has been heavily called in the > search > function. That should be the way to pick the candidate, shouldn't > it? > > I have never done this and I am worried that writing it in C would > push the > project's deadline a little bit further. However, does anyone have > any hint > on doing this? What are the recommended readings? > > Anyhow, I've decrease the MaxClients to 3 and it worked!!! The speed > > significantly increases, from average of 110 sec/request to 85 > sec/request. > But, that's not enough. I need less than 10 sec/request. > > Is that possible without changing hardware?
I see from an earlier post on the mason-users list that your app is using HTML::Mason and Apache::Session::Memcached. It seems like you've got quite a few variables to juggle in your performance bottleneck analysis. Have you tried switching to, say, Apache::Session::MySQL to see if there is any difference? You can also try these measures with your app: - Use static source mode in mason, and preload components: http://masonhq.com/docs/manual/Admin.html#static_source_mode - Preload (some/all) of your perl modules in the httpd parent using the PerlModule apache directive - If you are connecting to a database, be sure to use Apache::DBI One cheap way to check for memory leaks (most probably introduced by your perl code if they exist) is to run httpd -X (non-forking mode) and watch the memory usage of httpd while you send some requests. You may also want to strace the process: # httpd -X & # strace -o /tmp/strace.out -p `pidof httpd` # tail -f /tmp/strace.out Then hit the server with some requests and watch the strace output. This is especially useful for finding I/O or IPC bottlenecks. good luck Tony