Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linux - mysql memory issue!! Pls Help

Status
Not open for further replies.

Forri

Programmer
Joined
Oct 29, 2003
Messages
479
Location
MT
Hi

So i have a linux box with PHP 5 and mysql installed!

When i start up the box and check the memory status i get the following:


Total memory: 93660k
Memory user: 56892k
Memory free: 36760k average (goes down grdually here)

Then the process:

Mysql: Average% 7.9



Then after using the website i have hosted the above number start to decrease...drastically:

After the first run of the web site:
Memory Free goes down to : 27224k
and Mysqld goes up to about 8.9%

After some time...
Memory Free goes down to : 3360M
and Mysqld goes up to about 10M

is this normal or? I know i haven't been careful on the programming side! but what i'm asking some checks i should make within the code so i can make sure to reduce the memory consumption; especially where mysql is involved!

Thanks
Nick
 
Ths is normal for linux.
heres my main database server (from the top command)

11:30am up 34 days, 23:40, 7 users, load average: 2.52, 1.12, 0.79
167 processes: 163 sleeping, 3 running, 1 zombie, 0 stopped
CPU states: 0.8% user, 0.7% system, 0.0% nice, 0.4% idle
Mem: 2065668K av, 2054292K used, 11376K free, 0K shrd, 29632K buff
Swap: 522232K av, 45808K used, 476424K free 1630748K cached


______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
thnks for reply....

So is it that after refreshing a couple of times it takes ages to load....its as if the system had crashed...but after about 40-60sec it comes !


Thanks
Nick
 
if your server is responding more and more sowly, run top to check what is using the memory/processor time, normally memory will decrease, performance should not be affected at all.

also check your httpd logs for errors etc.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
There is nothing special going on apart from the ones i described above! The http logs are clean!

Tahnks anyways!
Nick
 
ps this is my top cmd:

Code:
 14:52:33  up  2:37,  2 users,  load average: 0.00, 0.01, 0.00
60 processes: 57 sleeping, 1 running, 0 zombie, 2 stopped
CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle
           total    0.5%    0.0%    0.3%   0.0%     0.0%    0.0%   99.0%
Mem:    93660k av,   89268k used,    4392k free,       0k shrd,   23096k buff
        21432k active,              58972k inactive
Swap:  127000k av,       0k used,  127000k free                   34356k cached
 
If you think that MySQL is the culprit have a look at what happens when you isssue queries. Log into MySQL as root and inspect what SHOW PROCESSLIST produces. Is there some locking going on for example if there is a specific query that "hangs" around and holds up the successively issued queries.
Also, look at the output from SHOW STATUS. Look at the number of slow queries.

BTW, maybe the people in the MySQL foum can assist you more with this.
 
hmmm seems a good starting point! thanks

Will try it in the morning and get you updated!

Tahnks again
Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top