LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 09-30-2003, 12:37 AM   #1
DigiCrime
Member
 
Registered: Dec 2002
Location: St. Louis
Distribution: All Flavors
Posts: 193

Rep: Reputation: 30
Freeing up Memory


Is it possible to free up memory without having to reboot it??

Currently I have a server that is using up 96% of its memory,

Physical Memory 96% 38.54 MB 967.98 MB 1006.52 MB
Disk Swap 7% 1.81 GB 145.49 MB 1.95 GB

During the night though not a lot is running on it, just a few things, couple users no big deal. Its a Xeon server.

Processors 4
Model Intel(R) Xeon(TM) CPU 2.00GHz
Chip MHz 1993.41
Cache Size 512 KB
System Bogomips 15925.22
PCI Devices Intel Corp. 82540EM Gigabit Ethernet Controller
ATI Technologies Inc Rage XL
ServerWorks CSB5 IDE Controller
LSI Logic / Symbios Logic (formerly NCR) 53c1030

IDE Devices hdc: SAMSUNG CD-ROM SC-148C

SCSI Devices FUJITSU MAP3735NP ( Direct-Access )
FUJITSU MAP3735NP ( Direct-Access )


I had someone look at it the other day saying that mysql and named was taking up most of the memory.

Top -at the moment

11:34pm up 38 days, 15:36, 2 users, load average: 0.21, 0.16, 0.16
124 processes: 123 sleeping, 1 running, 0 zombie, 0 stopped
CPU0 states: 0.0% user, 0.0% system, 0.0% nice, 100.0% idle
CPU1 states: 1.0% user, 0.1% system, 0.0% nice, 98.0% idle
CPU2 states: 4.1% user, 3.1% system, 0.0% nice, 91.1% idle
CPU3 states: 0.0% user, 0.0% system, 0.0% nice, 100.0% idle
Mem: 1030676K av, 1010960K used, 19716K free, 0K shrd, 102272K buff
Swap: 2048276K av, 148976K used, 1899300K free 594536K cached


Sorted by memory
19219 mysql 9 0 55972 53M 1372 S 0.0 5.2 0:54 mysqld
19221 mysql 9 0 55972 53M 1372 S 0.0 5.2 0:04 mysqld
19222 mysql 9 0 55972 53M 1372 S 0.0 5.2 0:22 mysqld
19224 mysql 9 0 55972 53M 1372 S 0.0 5.2 36:57 mysqld
19244 mysql 9 0 55972 53M 1372 S 0.0 5.2 38:59 mysqld
19358 mysql 9 0 55972 53M 1372 S 0.0 5.2 35:26 mysqld
19472 mysql 9 0 55972 53M 1372 S 0.0 5.2 36:12 mysqld
19753 mysql 9 0 55972 53M 1372 S 0.0 5.2 35:39 mysqld
19840 mysql 10 0 55972 53M 1372 S 18.0 5.2 36:04 mysqld
21313 mysql 9 0 55972 53M 1372 S 0.2 5.2 36:59 mysqld
22681 mysql 9 0 55972 53M 1372 S 0.0 5.2 35:58 mysqld
23487 mysql 9 0 55972 53M 1372 S 0.0 5.2 36:46 mysqld
31030 mysql 9 0 55972 53M 1372 S 0.0 5.2 33:17 mysqld
31031 mysql 9 0 55972 53M 1372 S 0.0 5.2 33:39 mysqld
344 mysql 9 0 55972 53M 1372 S 0.0 5.2 32:45 mysqld
346 mysql 9 0 55972 53M 1372 S 0.0 5.2 34:13 mysqld
353 mysql 14 0 55972 53M 1372 S 4.8 5.2 34:16 mysqld
1410 mysql 9 0 55972 53M 1372 S 0.0 5.2 32:24 mysqld
1411 mysql 9 0 55972 53M 1372 S 0.0 5.2 33:04 mysqld
14217 mysql 9 0 55972 53M 1372 S 4.1 5.2 24:34 mysqld
14218 mysql 9 0 55972 53M 1372 S 0.0 5.2 24:39 mysqld
1302 named 9 0 36424 35M 1544 S 0.0 3.5 0:00 named
1304 named 9 0 36424 35M 1544 S 0.0 3.5 0:04 named
1305 named 9 0 36424 35M 1544 S 0.0 3.5 6:08 named
1306 named 9 0 36424 35M 1544 S 0.0 3.5 6:10 named
1307 named 9 0 36424 35M 1544 S 0.0 3.5 6:11 named
1308 named 9 0 36424 35M 1544 S 0.0 3.5 6:10 named
1309 named 9 0 36424 35M 1544 S 0.0 3.5 0:08 named
1310 named 9 0 36424 35M 1544 S 0.0 3.5 4:57 named
14950 nobody 9 0 19788 18M 4852 S 0.0 1.8 0:02 httpd
14979 nobody 9 0 19224 18M 4784 S 0.2 1.8 0:01 httpd
14959 nobody 9 0 19164 18M 4720 S 1.3 1.7 0:01 httpd
14958 nobody 14 0 18840 17M 4772 S 2.4 1.7 0:01 httpd
14952 nobody 9 0 17900 16M 4728 S 0.6 1.6 0:01 httpd
14948 nobody 9 0 17052 16M 4700 S 0.0 1.5 0:00 httpd
14949 nobody 9 0 16988 15M 4800 S 0.2 1.5 0:00 httpd


as you can tell mysql is taking up most of the memory and named.

my.conf
[mysqld]
max_connections = 500
key_buffer_size = 16M
myisam_sort_buffer_size = 32M
join_buffer_size = 2M
read_buffer_size = 2M
sort_buffer_size = 3M
table_cache = 1500
thread_cache_size = 128
wait_timeout = 14400
connect_timeout = 10
max_allowed_packet = 2M
max_connect_errors = 10
query_cache_limit = 1M
query_cache_size = 16M
query_cache_type = 1
skip-innodb

[mysqld_safe]
open_files_limit = 8192

[mysqldump]
quick
max_allowed_packet = 2M

[myisamchk]
key_buffer = 150M
sort_buffer = 1M
read_buffer = 1M
write_buffer = 16M

Would like to optimize this machine, not to sure adding another gig of ram is really gonna help it much suggestions/ideas?

-Ron
 
Old 09-30-2003, 01:10 AM   #2
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,155

Rep: Reputation: 56
It looks pretty much normal. Servers use a lot of memory. The memory may actually available for applications when needed. There is normally a lot of cached and buffered memory.

try looking at

Code:
cat /proc/meminfo
more ram should get you out of the virtual memory for a while.
 
Old 09-30-2003, 01:12 AM   #3
DigiCrime
Member
 
Registered: Dec 2002
Location: St. Louis
Distribution: All Flavors
Posts: 193

Original Poster
Rep: Reputation: 30
root@midwest []# cat /proc/meminfo
total: used: free: shared: buffers: cached:
Mem: 1055412224 910721024 144691200 0 116559872 595152896
Swap: 2097434624 153747456 1943687168
MemTotal: 1030676 kB
MemFree: 141300 kB
MemShared: 0 kB
Buffers: 113828 kB
Cached: 482976 kB
SwapCached: 98228 kB
Active: 566368 kB
ActiveAnon: 184752 kB
ActiveCache: 381616 kB
Inact_dirty: 90456 kB
Inact_laundry: 73956 kB
Inact_clean: 50152 kB
Inact_target: 156184 kB
HighTotal: 131008 kB
HighFree: 1024 kB
LowTotal: 899668 kB
LowFree: 140276 kB
SwapTotal: 2048276 kB
SwapFree: 1898132 kB
root@midwest []#
 
Old 09-30-2003, 03:33 AM   #4
wapcaplet
Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
Unless you are actually encountering problems with not having enough memory to run programs, there's probably nothing to worry about. Why have all that RAM and not use it? It's using power whether it's being used by programs or not.
 
Old 09-30-2003, 07:40 AM   #5
DigiCrime
Member
 
Registered: Dec 2002
Location: St. Louis
Distribution: All Flavors
Posts: 193

Original Poster
Rep: Reputation: 30
not really any problems, just slow loading sites that use mysql
 
Old 09-30-2003, 08:25 AM   #6
yapp
Member
 
Registered: Apr 2003
Location: Netherlands
Distribution: SuSE (before: Gentoo, Slackware)
Posts: 613

Rep: Reputation: 30
If your site is really slow, you might want to look at the amount of queries you send to your MySQL server, and how much data they require. For example, a "SELECT *" in generally a bad idea. joining tables and such is even worse.

There is one other thing: you basically don't want your machine to swap! Writing to the HD is an expensive process, for both HD and CPU.. certainly if you're trying to alter a large database at the same time. And the Linux 2.4.x kernel isn't able to handle read requests while it's writing to the disk.

Last edited by yapp; 09-30-2003 at 08:32 AM.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Freeing Up Used Memory zoso Linux - Newbie 7 01-11-2005 10:44 PM
freeing memory in linux har5ha Linux - Software 7 07-23-2004 06:00 PM
stops at freeing unused kernel memory rtr Linux - General 1 12-09-2003 11:42 AM
Hang after freeing unused kernel memory darkcloud Linux - General 9 07-07-2003 09:12 PM
What Happened to Freeing up my Memory/Resources? johan the olive Linux - Hardware 2 02-27-2003 03:14 PM


All times are GMT -5. The time now is 07:29 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration