Re: [PHP-INSTALL] Performance problem with some php scripts...

[email protected] (Keith Roberts)
Newsgroups php.install
Message-ID <[email protected]>
On Thu, 30 Apr 2009, Juraj Remenec wrote:

> To: [email protected]
> From: Juraj Remenec <[email protected]>
> Subject: [PHP-INSTALL] Performance problem with some php scripts...
> 
> Hello.
> I have a serious problem and i'm not able to identify the error.
>
> MY FORMER SERVER:
> ------------------------------------
> CPU: Intel Celeron 2.4 GHz
> 2 GB RAM
> 4x 500 GB HDD configurated as JBOD (2 TB)
> Connect to 100 MBit internet link  (gigabith ethernet card)
> OS: Fedora Core v. 6 - 32bit,
> Programs: PHP 5.2.1, Apache 2, Zend optimizer 3
>
>
> MY ACTUAL, NEW SERVER:
> -------------------------------------
> AMD Phenom(tm) 9550 Quad-Core Processor - 2.2 GHz
> 8 GB RAM
> 3x 1.5 TB Seagate SATA (/home, /home2, /home3)
> Connect to 100 MBit internet link   (gigabith ethernet card)
> OS: Debian Lenny - 64 bit
> Programs: Apache2.2 as prefork + PHP5.2.6-lenny2 as module
> (libapache2-mod-php5) and Zend optimizer 3.3.3 (last version)
>
>
> I'm running own version of file-share server, similar to rapidshare.com.
> So my users can upload files and download them later on.
> In addition to classical upload from users pc i offer also an option
> of "URL Upload" -
> user inputs to the form url to a file, which is on another server and
> my system downloads it,
> stores it and makes it available for download.
>
> My site is running on a collection of PHP scripts called "MEGA FILE
> HOSTING SCRIPTS"
> (http://yabsoft.com/mfhs-feature.php).
>
> On my former server, when i was using url uploading i was able to
> reach the speeds of 20 000 - 30 00 kbps (~20-30 MBits).
> BUT since i have a new server hardware, the speed is not more than ~5000 kbps.
> In exceptional cases (when I restart apache) it goes to ~7000 kbps for
> a while (first 2-5 sec).
>
> The error can not be related to my provider or caused by slow internet
> connection because when I download the same file
> with program "links" in shell on server, the speed arises to 20-30 Mbps.
>
> MFHS scripts on the new server are the same as on my former server.
>
> Because of this, i see the only possibility in php and apache
> configuration or something else? :-o
>
> The autor of mega file hosting script is not responding to my question
> and his system is too big and complex to start
> studying it and try to find the error. The only thing what I have
> discovered is that the system is calling cgi scripts when uploading
> and this cgi one is calling another php scripts and among the library
> [httpclient] (http://www.phpclasses.org/browse/package/3.html) is
> beign used.  .
>
> Please, do you know something about a limitation or can you advice me
> where to look for the strange error?
> I tried to switch to apache2-mpm-worker with php5-cgi - but it did not
> help so i decided to switch back to prefork.
>
> I suspect also this 64 bit version of debian.
> May be the error is somewhere there?
>
> MANY THANKS FOR YOU ANSWERS, ADVICES OR GUIDANCE.
>
> Remenec.

You could try using a memory process monitor like qps, to 
see what resources are being used:

Qps is a visual process manager, an X11 version of "top" or 
"ps" that displays processes in a window and lets you sort 
and manipulate them.

It may be packaged already with your system. If not you can 
get it from:

http://www.student.nada.kth.se/~f91-men/qps/

There's some interesting notes about qps on the home page :)

I noticed that using PHP with eclipse slowed my system down.

Typing 'php' into the search box showed me several instances 
of php running, even after the PHP debug sessions were 
ended. So I had to kill them manually.

You can limit the search by typing things like httpd mysql 
php etc into the search box.

qps will also show you how much memory and CPU % a process 
is consuming.

You need to run qps as root user to be able to kill 
processes not owned by yourself.

HTH

Keith Roberts

-----------------------------------------------------------------
Websites:
http://www.php-debuggers.net
http://www.karsites.net
http://www.raised-from-the-dead.org.uk

All email addresses are challenge-response protected with
TMDA [http://tmda.net]
-----------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.