hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Server Using Swap... Why Is That?
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

Server Using Swap... Why Is That?

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 01-12-2003, 11:15 PM
LancerForums LancerForums is offline
WHT Addict
 
Join Date: Jan 2002
Posts: 150
Question

Server Using Swap... Why Is That?


I'm on a new server with the following specs:

- P4 2GHz
- 1 GB RAM
- 80 GB 7200RPM Drive
- RH Linux 7.2
- PHP 4.3.0
- MySQL 3.23.41

Recently the server would get slow for brief moments so I SSH'd in and checked out top and saw this:
Code:
 2:09pm up 3 days, 20:28, 1 user, load average: 0.48, 0.68, 0.63
133 processes: 130 sleeping, 3 running, 0 zombie, 0 stopped
CPU states: 26.7% user, 6.0% system, 0.0% nice, 67.2% idle
Mem: 1031184K av, 1016808K used, 14376K free, 0K shrd, 78936K buff
Swap: 1044216K av, 5236K used, 1038980K free 802480K cached
It looks like my memory is almost all used up and some disk swap is starting to be used. My site averages about 1xx people on a day and can reach over 200 or more at times. Could I just need additional memory or do I most likely have to tweak a few settings to get things straight. Also, is it possible I have a memory leak that's causing the memory to disipate?

Here's my my.cnf:
Code:
[mysqld]
port = 3306
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-locking
set-variable = max_connections=450
set-variable = key_buffer=16M
set-variable = myisam_sort_buffer_size=64M
set-variable = join_buffer=1M
set-variable = record_buffer=1M
set-variable = sort_buffer=2M
set-variable = table_cache=1024
set-variable = thread_cache_size=256
set-variable = wait_timeout=9600
set-variable = connect_timeout=10
set-variable = max_allowed_packet=16M
set-variable = max_connect_errors=10
[mysql.server]
user=mysql
basedir=/var/lib
[safe_mysqld]
open_files_limit=8192
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[mysqldump]
quick
set-variable = max_allowed_packet=16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
set-variable = key_buffer=128M
set-variable = sort_buffer=128M
set-variable = read_buffer=2M
set-variable = write_buffer=2M
[myisamchk]
set-variable = key_buffer=128M
set-variable = sort_buffer=128M
set-variable = read_buffer=2M
set-variable = write_buffer=2M
[mysqlhotcopy]
interactive-timeout
And here's my dbstats:
http://www.evolutionm.net/dbstats.php

Thanks,

Mark

Reply With Quote


Sponsored Links
  #2  
Old 01-12-2003, 11:57 PM
Mdot Mdot is offline
Web Hosting Master
 
Join Date: Feb 2002
Posts: 981
not enough memory, that's why it is using up swap.
52mb of used swap, is to early to worry about memory leak

__________________
Powered by AMD & FreeBSD.
"Documentation is like sex:
when it is good, it is very, very good;
and when it is bad, it is better than nothing."

Reply With Quote
  #3  
Old 01-12-2003, 11:58 PM
The Prohacker The Prohacker is offline
iNET Interactive
 
Join Date: May 2001
Location: Dayton, Ohio
Posts: 4,869
Try upgrading to the latest MySQL...

Your my.cnf looks fine and 1gb SHOULD be enough, not quite sure though yet...

Mind doing a free -m?

__________________
-Mat

Reply With Quote
Sponsored Links
  #4  
Old 01-13-2003, 01:56 AM
LancerForums LancerForums is offline
WHT Addict
 
Join Date: Jan 2002
Posts: 150
Here's the results of free -m:
Code:
             total       used       free     shared    buffers     cached
Mem:          1007        947         59          0         77        736
-/+ buffers/cache:        133        873
Swap:         1019          5       1014
Mark

Reply With Quote
  #5  
Old 01-13-2003, 04:36 AM
goldenplanet goldenplanet is offline
Web Hosting Guru
 
Join Date: Jul 2002
Location: Kolding, Denmark
Posts: 292
No problem whatsoever in your memory usage:

2:09pm up 3 days, 20:28, 1 user, load average: 0.48, 0.68, 0.63
133 processes: 130 sleeping, 3 running, 0 zombie, 0 stopped
CPU states: 26.7% user, 6.0% system, 0.0% nice, 67.2% idle
Mem: 1031184K av, 1016808K used, 14376K free, 0K shrd, 78936K buff
Swap: 1044216K av, 5236K used, 1038980K free 802480K cached

Out of 1 GB RAM approximately 800 MB is used as cache - that is, only 200 MB is used by apps. That's perfectly normal since Linux uses otherwise wasted memory space as cache to speed up things as much as possible.

I've seen systems using 500 MB swap and having 800 MB cached - no problems since the cache is larger than the swap.

__________________
Best regards,

Anders C. Madsen
Golden Planet Support - http://www.goldenplanet.com

Reply With Quote
  #6  
Old 01-13-2003, 09:58 AM
LancerForums LancerForums is offline
WHT Addict
 
Join Date: Jan 2002
Posts: 150
Oh, I thought the cache at the bottom was for swap, so I got all confused! Thansk for the heads up.

Mark

Reply With Quote
  #7  
Old 01-13-2003, 10:07 AM
Travis Travis is offline
Web Hosting Guru
 
Join Date: Oct 2000
Posts: 337
One more thing to keep in mind is that Linux will swap out idle pages, even if it doesn't need to, to make more room available for cache.

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Web Host 1&1 Internet Adds Server Restoration Tool for Virtual Machines Web Hosting News 2012-11-07 15:45:16
Web Host OrcsWeb Offers Support for Windows Server 2012 Web Hosting News 2012-08-24 11:08:35
Web Host ServInt Overhauls Dedicated Managed Servers with New Flex Line Web Hosting News 2012-03-13 10:48:00
Web Host 1&1 Enhances Dedicated Server Line with 32 Core, 64 GB RAM Server Web Hosting News 2011-12-20 15:30:05
DiscountASP.NET Launches Free Beta for Microsoft SQL Server 2012 Hosting Web Hosting News 2011-12-13 22:02:03


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?