OpenVZ Forum


Home » General » Support » How come, that my VDS system uses that much rams?
How come, that my VDS system uses that much rams? [message #40083] Thu, 15 July 2010 15:32 Go to next message
newn is currently offline  newn
Messages: 4
Registered: July 2010
Junior Member
Hi everyone. I have bought a VDS system with 1 gig of rams. I think it uses OpenVZ instead of CentOS 5.

2.6.18-194.3.1.iv.028stab069.6 x86_64 x86_64
centos-release-5-5.el5.centos

I'm not very advanced in linux, but every time i enter my website of WP, it takes a lot of rams. When i surf, i eats even more. Today i went to it to check the ram usage again, and first time i entered, it took 70MBs from 100. Then i went to do something, i get back, i check the free rams availbale, it says it's 60. So +30MB while i was away from the website for a few minutes, then i enter it again. It eats 30 more megabytes. After that i hit admin board link on the site, it eats 20 more. That way, my server has <10 megabytes left.

My server hosts two programs, which eats a lot of rams, but it's not increasing, it eats it stabile. You start it, it takes some amount, it stays that way. It doesn't changes. Maybe +-10mb.

So anyway, how come, that simple website hits takes that much memory? After that, website sometimes doesn't load at all. I mean just a blank page or some contents of the website is blank, of half of the website is loaded only... Plus sometimes people (since those two other perograms are servers) cannot join to these servers.

So anyway, how can i fix this? Expluding adding more rams. I'm a student from a poor country and i get 100$ a year during my birthday. To add 512 megabytes, i would need to pay ~5$ a month more. Si 12*5... Well, doesn't add up too nicely.
Re: How come, that my VDS system uses that much rams? [message #40091 is a reply to message #40083] Thu, 15 July 2010 19:24 Go to previous messageGo to next message
khorenko is currently offline  khorenko
Messages: 533
Registered: January 2006
Location: Moscow, Russia
Senior Member
Hi!

could you please check your "free" output? May be there is a lot of memory used for caches and buffers? If yes - then it's not a problem, just check for details:

http://forum.openvz.org/index.php?t=msg&&th=7314& ;goto=35283

Hope that helps!

--
Konstantin


If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
Re: How come, that my VDS system uses that much rams? [message #40092 is a reply to message #40091] Thu, 15 July 2010 21:17 Go to previous messageGo to next message
newn is currently offline  newn
Messages: 4
Registered: July 2010
Junior Member
Yea, free -m tells me, that it has 0 rams free. That's what gives me the problem. Sometimes <10. Sometimes it cannot even be run. And when i restart the server, until i go to the website, it's ~200.

Also it has no swap memory.

As for " May be there is a lot of memory used for caches and buffers?" Sorry, i'm not very advanced Linux user, i don't know how to check for that. :/
Re: How come, that my VDS system uses that much rams? [message #40093 is a reply to message #40092] Thu, 15 July 2010 21:22 Go to previous messageGo to next message
khorenko is currently offline  khorenko
Messages: 533
Registered: January 2006
Location: Moscow, Russia
Senior Member
Just check the 2 last columns in "free -m" output - their names are "buffers" and "cached". Smile

If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
Re: How come, that my VDS system uses that much rams? [message #40094 is a reply to message #40093] Thu, 15 July 2010 21:34 Go to previous messageGo to next message
newn is currently offline  newn
Messages: 4
Registered: July 2010
Junior Member
Oh, sorry. It's all zeros. Here you go the info about just restarted server:

total used free shared buffers cached
Mem: 1024 154 869 0 0 0
-/+ buffers/cache: 154 869
Swap: 0 0 0


Now i enter the websites:

total used free shared buffers cached
Mem: 1024 332 691 0 0 0
-/+ buffers/cache: 332 691
Swap: 0 0 0

[Updated on: Thu, 15 July 2010 21:35]

Report message to a moderator

Re: How come, that my VDS system uses that much rams? [message #40100 is a reply to message #40094] Fri, 16 July 2010 13:35 Go to previous messageGo to next message
khorenko is currently offline  khorenko
Messages: 533
Registered: January 2006
Location: Moscow, Russia
Senior Member
Well, but may be all the memory is really allocated? just post here (when you almost have no free memory):
# cat /proc/user_beancounters
# ps axfl --sort=-vsize

Thank you.

--
Konstantin


If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
Re: How come, that my VDS system uses that much rams? [message #40106 is a reply to message #40100] Fri, 16 July 2010 22:24 Go to previous messageGo to next message
newn is currently offline  newn
Messages: 4
Registered: July 2010
Junior Member
Version: 2.5
       uid  resource                     held              maxheld              barrier                limit              failcnt
      309:  kmemsize                 11445722             14686333             58720256             67108864                    0
            lockedpages                     0                    0                 4096                 4096                    0
            privvmpages                259626               287663               262144               262144              2175886
            shmpages                     1311                 5167               262144               262144                    0
            dummy                           0                    0                    0                    0                    0
            numproc                        60                   76                 1024                 1024                    0
            physpages                  142874               151241                    0  9223372036854775807                    0
            vmguarpages                     0                    0               229376               229376                    0
            oomguarpages               142875               151242               229376               229376                    0
            numtcpsock                     32                  122                 4096                 4096                    0
            numflock                        6                   12                 4096                 4096                    0
            numpty                          3                    7                   16                   16                    0
            numsiginfo                      0                   61                 4096                 4096                    0
            tcpsndbuf                  339008               880016             14680064             16777216                    0
            tcprcvbuf                  541728              2855832             14680064             16777216                    0
            othersockbuf                33392              2749624             14680064             16777216                    0
            dgramrcvbuf                  1288              7376376             14680064             16777216                    0
            numothersock                   29                   62                 4096                 4096                    0
            dcachesize                 792516               885477             58720256             67108864                    0
            numfile                      1788                 2259                16384                16384                    0
            dummy                           0                    0                    0                    0                    0
            dummy                           0                    0                    0                    0                    0
            dummy                           0                    0                    0                    0                    0
            numiptent                      10                   10                 4096                 4096                    0


and

4     0     1     0  15   0  10348   740 -      Ss   ?          0:00 init [3]
1     0  7590     1  15   0 289228 10272 -      Ss   ?          0:00 /usr/sbin/httpd
5    48 22099  7590  15   0 335580 52096 -      S    ?          0:03  \_ /usr/sbin/httpd
5    48 14123  7590  15   0 334128 52216 -      S    ?          0:25  \_ /usr/sbin/httpd
5    48 14150  7590  15   0 332508 50356 -      S    ?          0:23  \_ /usr/sbin/httpd
5    48 22005  7590  15   0 328616 46688 -      S    ?          0:04  \_ /usr/sbin/httpd
5    48 17647  7590  15   0 324252 41996 -      S    ?          0:19  \_ /usr/sbin/httpd
0     0  9512     1  15   0  94008 21148 -      S    ?          0:39 /usr/bin/perl ./hlstats.pl --port=PORT
0     0  9516     1  15   0  94008 21072 -      S    ?          0:13 /usr/bin/perl ./hlstats.pl --port=PORT
5     0  7466     1  15   0  62624  1204 -      Ss   ?          0:00 /usr/sbin/sshd
4     0 32454  7466  15   0  86060  3332 -      Ss   ?          0:00  \_ sshd: root@pts/0
4     0 32466 32454  15   0  12064  1728 wait   Ss   pts/0      0:00  |   \_ -bash
4     0 12169 32466  17   0   8628   844 -      R+   pts/0      0:00  |       \_ ps axfl --sort=-vsize
4     0  9334  7466  15   0  86056  3364 -      Ss   ?          0:00  \_ sshd: root@notty
4     0  9336  9334  15   0  53872  2056 -      Ss   ?          0:00      \_ /usr/libexec/openssh/sftp-server
5     0 24109     1  15   0  23004  1500 -      Ss   ?          0:00 SCREEN -A -m -d -S 
4     0 24110 24109  21   0   9968  1404 wait   Ss+  pts/1      0:00  \_ /bin/sh ./srcds_run
0     0 24112 24110  15   0 326644 136368 stext Sl+  pts/1    103:48      \_ ./srcds_linux
5     0 30518     1  15   0  22824  1320 -      Ss   ?          0:00 SCREEN -A -m -d -S 
4     0 30519 30518  18   0   9972  1420 wait   Ss+  pts/2      0:00  \_ /bin/sh ./srcds_run 
0     0 11772 30519  15   0 323824 137004 stext Sl+  pts/2      2:56      \_ ./srcds_linux 
1     0  7478     1  25   0  21644   880 -      Ss   ?          0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid
1     0  7599     1  15   0  20868  1168 -      Ss   ?          0:00 crond
5     0  7175     1  21  -4  12604   672 -      S<s  ?          0:00 /sbin/udevd -d
4     0  7512     1  25   0  11928  1408 wait   S    ?          0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --log-error=/var/lo
4    27  7564  7512  15   0 269784 39912 stext  Sl   ?          3:18  \_ /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysq
1     0  7454     1  15   0   5908   608 -      Ss   ?          0:00 syslogd -m 0



9 megabytes of free memory.
Re: How come, that my VDS system uses that much rams? [message #40124 is a reply to message #40106] Mon, 19 July 2010 09:22 Go to previous message
khorenko is currently offline  khorenko
Messages: 533
Registered: January 2006
Location: Moscow, Russia
Senior Member
Well, looks like your applications really allocate all the memory available on the node:
you can see this by failcounters for "privvmpages" parameter.

If you cannot do anything with processes running inside the Container, the only way left is to increase the privvmpages value (read - buy an account with more memory).

Alternatively you can try somehow to optimize the processes inside CT in order not to ALLOCATE a lot of RAM while real USE of that memory is not so high.

According to "oomguarpages" usage value all processes really USE only 140Mb of RAM, all the other memory (1Gb-140Mb) is just allocated, but not really used.

You can check the processes one by one from your "ps" output and check "VSZ" and "RSS" values: the first one is how much is ALLOCATED, the later - how much is used. After that just take a look at applications configurations - if you can somehow tell them not to PREALLOCATE too much memory, for example for some application internal buffers/caches, etc.

Hope that helps.

--
Konstantin


If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
Previous Topic: Problems with new IP range
Next Topic: X-Server inside Container?
Goto Forum:
  


Current Time: Fri Oct 18 05:14:04 GMT 2024

Total time taken to generate the page: 0.05225 seconds