Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Slow Server - LOTS of processes - sugg. for speedups?

Posted on 2004-08-22
4
Medium Priority
?
217 Views
Last Modified: 2007-12-19
My server is running Apache 1.3.27. I have a perl program called ad.pl that sits in a cgi-bin directory. It is called from a remote web page like this:

<IFRAME SRC="http://my server/cgi-bin/ad.pl?some_arguments"></IFRAME>

This program is accessed about 6-10 times every second.

The program connects to MySQL, does a couple lookups, returns some data, and finishes. However, it seems like Apache and Perl are the bottlenecks here. If I run a ps -aux, I get about 100-150 of these Apache processes:

apache   13038  0.0  0.8 82972 4040 ?        S    14:50   0:00 /usr/sbin/httpd -f /etc/httpd/conf/httpd_app.conf -DSSL -DSSL.default -D product_wp_module -D vwh_frontpage_module -D vwh_httpd_defines_module -D vwh_httpdmon_module -D vwh_perl_module -D vwh_php4_module

then there's about 10 MySQL processes, and then about 90 or so of these Perl processes:

admin3   24012  0.0  0.6  4296 3072 ?        R    15:08   0:00 /usr/bin/perl -w ad.pl

MySQL is running on the my-medium.cnf configuration.

Can anyone offer some additional tips on speeding up Apache and Perl? (One thing that I noticed is that when PHP files run, they don't spawn a bunch of PHP executable processes like /usr/bin/php (like Perl is doing). This is a client's server, so I don't know EXACTLY how the server is set up, but I have a good idea. Thanks in advance!

- Jonathan
0
Comment
Question by:gr8gonzo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 35

Author Comment

by:gr8gonzo
ID: 11865332
One more thing - I also noticed that the ad.pl file is suexec-ing (since it is run from a non-privileged account called admin3). I don't know how much that affects speed, or if it can be circumvented (not sure why it needs to suexec in the first place)...

- Jonathan
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 2000 total points
ID: 11865389
> This program is accessed about 6-10 times every second.
> noticed that the ad.pl file is suexec-ing
both are performance bottlenecks, you should think about a solution where your CGI uses persistent connections to mysql, or a connection pool. ALso try to get rid of the suexec (if possible).
You either need something like fastCGi, or write a small perl script which connects to mysql permanently and servers the request from your ad.pl (which then connects to the new script instead of to mysql direct).
0
 
LVL 34

Expert Comment

by:PsiCop
ID: 11865519
Yes, suexec IS a potential security hole. Eliminate it if at all possible.

Launching Perl processes is expensive (in terms of computing power). This is why some Perl-intensive applications (MIMEdefang, for example) use a multiplexor to create a number of reusable Perl sessions. You need to do something like this (to which ahoffman alluded above).
0
 
LVL 35

Author Comment

by:gr8gonzo
ID: 11887888
Thanks for the tips!
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month8 days, 7 hours left to enroll

596 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question