Gossamer Forum
Home : General : Databases and SQL :

Suse+PHP+Mysql crash because of lack of memory

Quote Reply
Suse+PHP+Mysql crash because of lack of memory
Hi,

I have a big problem.

I have a web site with php and mysql (very large database). I don't know why the server memory and swap is filled to the end and than the server refuse to execute any php script. It said that at line xxx in yyy.php can't allocate more memory.

I use mysql_free_result and unset to dealocate resources in php scripts.

The server is an AMD Duron 800, 256MB.

Then when i restart the server all is ok, but the error still appear after 4-5 days.

WHY???

Why t
Quote Reply
Re: [erc] Suse+PHP+Mysql crash because of lack of memory In reply to
How about setting a cron job to restart MySQL daily? It may cause a few problems with people executing queries when it is executing, but it should hopefully clear up the free memory, and allow it to be re-allocated for more tasks... Thats what I ended up doing on one of my old servers, which only had 128Mb RAM Tongue

Hope that helps Smile

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Suse+PHP+Mysql crash because of lack of memory In reply to
Dear dear dear......you shouldn't be doing that at all.

erc:

Does this happen with all scripts that use mysql or just this particular one?

Also how big is the database?

Last edited by:

Paul: Oct 23, 2002, 8:18 AM
Quote Reply
Re: [Paul] Suse+PHP+Mysql crash because of lack of memory In reply to
In Reply To:
Dear dear dear......you shouldn't be doing that at all.

I said USED TO Wink I'm not doing it on my 3rd server, which is a 2Ghz Wink

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Suse+PHP+Mysql crash because of lack of memory In reply to
Yeah well I'm pointing out that isn't a good option incase erc chose to attempt it Tongue

The fact that it is 2ghz bares no real relevance on memory usage.

Last edited by:

Paul: Oct 23, 2002, 9:26 AM
Quote Reply
Re: [Paul] Suse+PHP+Mysql crash because of lack of memory In reply to
Hi,

This problem happend with all scripts that use mysql. On my web site i have only 6-7 php files but very large ones, because one file is actualy 4-5 files that are deferenced by a parameter send from a form.

The database is about 40MB (the directory on mysql/data) and it has in total 600.000 records.

The solution is to make a cron file to restart mysql server, let's say at midnight?

There is another solution?
Quote Reply
Re: [Paul] Suse+PHP+Mysql crash because of lack of memory In reply to
You realy can't give me an ideea how to fix the problem?
Quote Reply
Re: [erc] Suse+PHP+Mysql crash because of lack of memory In reply to
Have you tried repairing your MySQL database and then re-starting MySQL daemon?
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Suse+PHP+Mysql crash because of lack of memory In reply to
What you mean by reparing my database?
Quote Reply
Re: [erc] Suse+PHP+Mysql crash because of lack of memory In reply to
Go to www.mysql.com and search for repair.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Suse+PHP+Mysql crash because of lack of memory In reply to
I was at www.mysql.com and i read all the errors that apear when a table is damaged and i don't have this errors.

Another ideea?