LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-23-2008, 03:17 PM   #1
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 321

Rep: Reputation: 30
Optimizing apache/mysql?


Quote:
Mem: 262144k total, 199844k used, 62300k free, 0k buffers
As you can see, I'm fairly close to my memory quota.

Code:
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1366 mysql     17   0 43344  18m 2508 S    0  7.3   0:14.56 mysqld
 1550 mysql     15   0 43344  18m 2508 S    0  7.3   0:14.48 mysqld
19660 mysql     15   0 43344  18m 2508 S    0  7.3   0:01.92 mysqld
19661 mysql     18   0 43344  18m 2508 S    0  7.3   0:00.02 mysqld
19667 mysql     15   0 43344  18m 2508 S    0  7.3   0:05.09 mysqld
19672 mysql     15   0 43344  18m 2508 S    0  7.3   0:17.31 mysqld
20149 mysql     15   0 43344  18m 2508 S    0  7.3   0:17.26 mysqld
30553 mysql     18   0 43344  18m 2508 S    0  7.3   0:14.62 mysqld
32619 mysql     16   0 43344  18m 2508 S    0  7.3   0:14.78 mysqld
18151 apache    15   0 36696  14m 3860 S    0  5.7   0:30.09 httpd
22312 apache    15   0 36532  14m 3852 S    0  5.6   0:31.59 httpd
21987 apache    15   0 36588  14m 3860 S    0  5.6   0:32.60 httpd
21989 apache    15   0 36632  14m 3852 S    0  5.6   0:32.96 httpd
21990 apache    15   0 36448  14m 3860 S    0  5.6   0:28.93 httpd
21988 apache    15   0 36512  14m 3864 S    0  5.6   0:33.69 httpd
18357 apache    15   0 36448  14m 3868 S    0  5.6   0:30.26 httpd
13959 apache    15   0 36372  14m 3856 S    0  5.6   0:19.28 httpd
18057 apache    15   0 36488  14m 3592 S    0  5.5   0:26.69 httpd
21986 apache    15   0 36296  14m 3772 S    0  5.5   0:32.03 httpd
18027 apache    15   0 36068  13m 3736 S    0  5.4   0:25.65 httpd
It seems Apache and MySQL are most of the load, even though I only have one low end website on the server.

How can I optimize the memory usage? I have made some edits already but didn't seem to help that much.
 
Old 07-23-2008, 03:21 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 256Reputation: 256Reputation: 256
Is the server getting slow or sluggish? You do realize that memory usage in Linux is very efficient. Unless you start swapping in your designated swap space and or processes are getting killed off due to memory problems, you really shouldn't have anything going on with these. Looks normal to me really.

But on the other hand, you can always still tune these to make your server faster to utilize all of it's potential.

But you still have actual memory free according to what you posted, so shouldn't be any problems, this is normal behavior in Linux. And I'm sure most of it is even cached.

Last edited by trickykid; 07-23-2008 at 03:22 PM.
 
Old 07-23-2008, 03:28 PM   #3
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 321

Original Poster
Rep: Reputation: 30
It seems to be sluggish at times, at least according to "LAG" messages on the MUD running on this VPS.
Quote:
1020.log:Tue Jul 22 20:00:37 2008 :: [*****] LAG: Araysa: kill s (R:4749 S:2.178663)
1020.log:Tue Jul 22 22:20:18 2008 :: [*****] LAG: Zeno: save (R:2500 S:1.631734)
1020.log:Tue Jul 22 23:20:27 2008 :: [*****] LAG: large demon: mpmload 1004 (R:1007 S:1.832185)
1020.log:Wed Jul 23 00:20:02 2008 :: [*****] LAG: large demon: mpmload 1004 (R:1007 S:1.916153)
1020.log:Wed Jul 23 01:05:28 2008 :: [*****] LAG: Aquan: finger Ludvic (R:2400 S:1.575886)
1020.log:Wed Jul 23 02:40:07 2008 :: [*****] LAG: large demon: mpmload 1004 (R:1007 S:1.850500)
1020.log:Wed Jul 23 02:40:07 2008 :: [*****] LAG: Sethanon: kill dem (R:1007 S:1.878465)
1020.log:Wed Jul 23 14:15:03 2008 :: [*****] LAG: Wentz: kill m (R:2616 S:1.846852)
I never had these lag messages on my last server.

I don't think I have swap space.
Quote:
Swap: 0k total, 0k used, 0k free, 0k cached
But if it's normal, I guess that's okay. I assume it was bad when my VPS was showing the memory usage % in a bright red with a red exclamation.

Last edited by Zeno McDohl; 07-23-2008 at 03:29 PM.
 
Old 07-24-2008, 02:32 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,735

Rep: Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523
Show the output of 'top'.
Also, I'd usually recommend having a swap partition, say 1 or 2 GB.
 
Old 07-24-2008, 09:32 AM   #5
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 321

Original Poster
Rep: Reputation: 30
My first post had the output of top.

As for swap, I don't know if my VPS lets me have any.
 
Old 07-24-2008, 09:41 AM   #6
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 256Reputation: 256Reputation: 256
Quote:
Originally Posted by Zeno McDohl View Post
My first post had the output of top.

As for swap, I don't know if my VPS lets me have any.
Sure it does. Might not have been setup with one but you can always create swap on a partition or by using a file.
 
Old 07-24-2008, 10:44 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,735

Rep: Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523
Actually I meant the full header in top eg
Code:
top - 13:43:00 up  2:08,  3 users,  load average: 0.45, 0.59, 0.47
Tasks: 128 total,   2 running, 126 sleeping,   0 stopped,   0 zombie
Cpu(s):  8.6%us,  7.3%sy,  0.0%ni, 84.1%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1294924k total,   730728k used,   564196k free,    56052k buffers
Swap:  2031608k total,        0k used,  2031608k free,   330800k cached
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
optimizing apache 2 schentor Linux - Software 2 09-08-2006 09:31 AM
LXer: Optimizing DSPAM + MySQL 4.1 LXer Syndicated Linux News 0 04-19-2006 10:54 PM
Optimizing Apache SiLiCoN Linux - Networking 2 06-15-2005 02:56 AM
optimizing apache alaios Linux - Networking 0 10-16-2004 12:08 PM
Apache optimizing Hamma Linux - Software 8 12-08-2003 07:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration