High mem problem PHP

every time when somebody visit a site on my server it uses more then 140 mb ram per client on each site why this occurs ?
is there any setting for this on cpanel
Untitled.png
LVL 1
CahitEyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fosiul01Commented:
do you see any error in your apache ??

or if your turned on php error reporting.. do you see any error while browsing the site ??


also how much ram you put on php.ini ??

also how did you compile our php with apache ???



fosiul01Commented:
also you should start to look into this product

http://xdebug.org/

its will helps to debug if there is any memory leack problem of your script ..

but before that try to find out what happening with the server
CahitEyAuthor Commented:
i have made double checkt to /usr/lib/php.ini
as seen on code part

where

i have compiled php with cpanel's interface without any error

where could i find error logs of apache and php ?
max_execution_time = 30     ; Maximum execution time of each script, in seconds
max_input_time = 60     ; Maximum amount of time each script may spend parsing request data
memory_limit = 32M      ; Maximum amount of memory a script may consume (32MB)

Open in new window

Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

fosiul01Commented:
if you install apache by yum install httpd

then /var/log/httpd/all error log ( error.log, yorudomain.com-error ..)

or if your install via source

it could be

/usr/local/apache/logs/ directory


try to turn on , errror-reporting from php.ini to see if its through any error

also try to increase debug log value from apache config directory
CahitEyAuthor Commented:
i think it is very huge so i decide it to install on a site check this out please :

http://3xlhost.com/error_log.txt
fosiul01Commented:
Ok those all are error.. but you should fixed some of those .. they might put impact on server


here, the way i configure php with Apache your configuration is different so here you got php as process  because you have cpanel


what i am trying to understand is :

suppose if 10 user browse your server concurrently is it creating  10 php process ????












CahitEyAuthor Commented:
unfortunatelly yes check the image 5 person hit the murat's site and the result :(
i have added 12 gb ram but it is not enough for nights :D that is non logical
Untitled.png
fosiul01Commented:
you have a php zombi process (defunct) kill that one

if its create 5 http + 5 php process.. pretty bad ....

what product you using ???

i guess its due to your cpanel  .....

need to find out if its normal for cpanel base server or its abnormal

for http process i saw process more then 100Mb depends size of your website ... this that


all your website, does it developed by u ?? or some top of the self product ?? what the name of your control panel ??

CahitEyAuthor Commented:
no it is just a vbulletin forum :S
also wordpress sites the same
i am using latest cpanel
fosiul01Commented:
dont like vbbulletin, it has bad reputation of memory lick anyway


if you turned off vbulletin and just keep browsing  word press

how much loads your has ??


CahitEyAuthor Commented:
eren is wordpress site also check this out
scr2.png
fosiul01Commented:
run this

<?php phpinfo(); ?>

see where is your php.ini located


or just create a page with

<?php phpinfo(); ?> , give it a name , phpinfo.php

sent me the link

let me have a look at your php.ini file...
CahitEyAuthor Commented:
check it from here please :
http://www.moviegy.com/
fosiul01Commented:
your php memory limit is set to 32 but its taking more hten 100Mb which does not make sense ...

is there any way to turnoff cpanel too see if it reduces memory uses ???

CahitEyAuthor Commented:
i do not think so, because it is working independent from httpd module , when i make a
service httpd stop
cpanel is going on working :)
but any of this is not logical there is sth. really wrong and i am having big problems on crowded hours
fosiul01Commented:
no, dont stop httpd process,

i dont know how cpanel works.. but can you not stop cpanel to run ????


or if you stop cpanel process , httpd will stop aswell ???
CahitEyAuthor Commented:
i have stoped cpanel now,
but still going on the same problem
sx.png
fosiul01Commented:
ommmmm dont know .... something not right...

I am running basic wordpress.. + modsecurity , httpd process is 58 MB each

your httpd is 72Mb which is fine...


but php proces is too big ...

let me google little bit ..

could not you compile php with apache ?? rather then php with cpanel!!!!



CahitEyAuthor Commented:
Cpanel's support answer as given below very funny :)
i am not able to build php without cpanel because this is a hosting enviroment for my friends and i need to use whm unfortunately ...
i will be looking forward for your answer i am also looking for a possible soluiton
additionally i am using a remote server for mysql :D
My message  :
Sir this is a vps and let me say that when you check the image you could see each client creating its own php and httpd session That is mean for every client my apache using 200 mb ram for a vbulletin form  (Not for db it is on another server) I have added 8 gb ram to this server and when my server gets 40 hits at the same time totally to all my sites It is down because it is over the swap and physical ram 40*200 = 8000 mb Without db connection for 40 client at the same time using 8 gb is logical ? 
There is nothing with physical problems here it is a simple maths problem I have 8gb ram and each client uses 200 mb totaly with php and httpd so 40 client is make my all server down On asp.net runs only one instance for 400 client and file4share.net is my site also i have seen there 1000 people at the same time without using more then 1 gb ram Please check this careffuly this is not a hardware issue


Cpanel's message


The usage you are referring to is the virtual size of the task. 

RES -> (53M, 45M, etc in the image) is the amount of RAM used by those processes and MEM -> shows the same in % 

When you say 500 clients connect to your server, do you mean that your site gets 500 simultaneous hits ? 
vbulletin, wordpress etc are database driven and such a huge number of hits will definitely overload the server. 

You need to discuss with your service provider (or decide on your own) and get a dedicated server for the site that gets more traffic. 

I understand your concern and know that you have opened many tickets regarding this, but we will be able to fix cpanel related issues only.   You should address these memory problems with your service provider and server administrator. 

 
Highest Regards,

Balaji S

Open in new window

fosiul01Commented:
Ok what he said is 60 % true....

RES is the main memory uses by the process..

but you should not forget VIRT.. which includes swap uses + memory uses...

I always look at VIRT to get a good idea ...


Now if they say that 53M RES   is a good reasonable value for php process .. then have to take their words as its their products

then you will have to increase your Ram...
also one thing

you got 300Mb fre ram and 300MB buffer
so you actually have 600MB free ram ...

the top result is that your pick time ??

or as you said, in pick time your server is totally down ??

one thing you need to understand 40 user browsing your site and 40 concurrent request

40 user browsing that does not mean that 40 user browsing concurrently




CahitEyAuthor Commented:
yes that is true when i count sessions of the users it is 400 nearly but if 40 hit gets from 400 user my server down but this is not normal 8gb ram for 400 - 500 user :S without db
check this
www.maxihayat.net this site is on another server with 16gb ram and quad processor
it gets 5000 active user and 160 site is using the same server

i give 8gbram and 4 processor of i7 but it gets down 400 users (40 hits)

what should i do more :S
fosiul01Commented:
and all these server (www.maxihayat.net  )  running on cpanel ?? and php consuming same amount of ram ???
CahitEyAuthor Commented:
it is running on plesk
the only difference that and as i said with 16 gb ram runs 160 site
maxihayat has 37000 active users :D
i could not understand how ?
fosiul01Commented:
Ok you got 2 server

(a)one is runinnuing  www.maxihayat.net which as 16GB of ram

(B) one is running cpanel 2 gb of ram (wordpress and another website)


now tell me :

for server (a) do you face any problem ?? like memory out or server down ???

for server (a) do you have php process as individuals ??


CahitEyAuthor Commented:
the other server is not mine it is one of my friend's and
it has faced with no problem as i said it is running 160+ sites with the same server of maxihayat and as you could see maxi hayat has 37000 active users
i am hosting a few site which has totally maybe 2000 users per day but it get down with 5gb ram, i have tryed with increasing memory, and also my mysql server is remote server , i mean it is not using mem from my server, but maxihayat's server use the mysql with the same server apache.
how this happens there is a huge difference
fosiul01Commented:
you saying its "it get down with 5gb ram"

but the picture of the server has only 2 GB of ram


CahitEyAuthor Commented:
i decreased back this is a virtual machine in a i7 machine
fosiul01Commented:
if you are up to experiment something then i might be able to help you ..

but without looking into server it would be hard to say anything from here ..


is there any way to rebuild another Virtual mechine..

but this time.. dont use cpanel .. compile apache php and mysql into same pc then put web site one by one , or if you trust me i can do that for you!!!!


it might give some lights ...... ( as i am not familiar of having php process on its own )

fosiul01Commented:
or you can Delete this question and ask again , some php guy might be able to help you on this issue

CahitEyAuthor Commented:
ok it is no problem ,
c.e@salay.com.tr if you send me an empty email i will send you an ssh access to a new virtual machine
please provide me how much ram do you want and cpu  thanks
but i will be do this a few hours later thank you
fosiul01Commented:
I sent you email

use 4GB of ram and more then 2/3 processor!!!

lets try with small config ,. if needs will increase later

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CahitEyAuthor Commented:
I am sorry for the lateness i was out of the city , i will send details thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.