Results 1 to 13 of 13

Thread: how kmemsize

  1. #1

    Question how kmemsize

    Hello,
    on our vps use alot of kmemsize but we do not know why
    please inform me by thing or scripts that using kmemsize

    regards

    red fox

  2. #2
    Join Date
    Dec 2004
    Location
    Butler,TN
    Posts
    2,413
    Hi!
    Well...take a look at good ole beanconters (if openvz or virtuozzo) by:

    cat proc/user_beancounters

    Feel free to post the output here...and I'll be more than happy to explain what those numbers mean. Yes..I am working on a FAQ for this...very common questions!

    Bryon
    Bryon L Harvey
    Soil Relocation Engineer

  3. #3
    Join Date
    Jun 2003
    Location
    UK
    Posts
    6,601
    From http://wiki.openvz.org/Kmemsize#kmemsize

    Size of unswappable memory, allocated by the operating system kernel.

    It includes all the kernel internal data structures associated with the Virtual Environment's processes, except the network buffers discussed below. These data structures reside in the first gigabyte of the computer's RAM, so called “low memory”.

    This parameter is related to the number of processes (numproc). Each process consumes certain amount of kernel memory — 24 kilobytes at minimum, 30–60 KB typically. Very large processes may consume much more than that.

    It is important to have a certain safety gap between the barrier and the limit of the kmemsize parameter (for example, 10%, as in UBC configuration examples). Equal barrier and limit of the kmemsize parameter may lead to the situation where the kernel will need to kill Virtual Environment's applications to keep the kmemsize usage under the limit.

    Kmemsize limits can't be set arbitrarily high. The total amount of kmemsize consumable by all Virtual Environments in the system plus the socket buffer space (see below) is limited by the hardware resources of the system. This total limit is discussed in “low memory”.

    -----

    Basically this means that any program that is wanting to keep its memory from not being swapped out to disk is using the kmemsize setting
    Russ Foster - Industry Curmudgeon

  4. #4
    Join Date
    Dec 2004
    Location
    Butler,TN
    Posts
    2,413
    Hi!
    I just realized we both may have missed the mark. I just realized he wants to know how to find what is using excessive memory.

    Ok..this is tricky..because if whatever is using the excess memory is not active when you run a ps axfuw command..it will not help. The best thing I can tell you..if you are monitoring load...when load is high..run that command.

    ps axfuw

    Now..there is another program that can show you MySQL memory usable..in a "top" like environment..it is called Mytop..and is available here:

    http://jeremy.zawodny.com/mysql/mytop/

    It has been my experience that MySQL usage is a big cause for this..as well as mailscanner..or other anti-spam programs.

    Bryon
    Bryon L Harvey
    Soil Relocation Engineer

  5. #5

    Question i still need help

    Quote Originally Posted by bryonhost1
    Hi!
    Well...take a look at good ole beanconters (if openvz or virtuozzo) by:

    cat proc/user_beancounters

    Feel free to post the output here...and I'll be more than happy to explain what those numbers mean. Yes..I am working on a FAQ for this...very common questions!

    Bryon
    thanks for your relpy
    please i need explain to me what is using kmemsize too much?
    because i do not understand well

    thanks in advanced for your helping

    regards

    red fox

  6. #6
    Join Date
    Dec 2004
    Location
    Butler,TN
    Posts
    2,413
    Hi!
    Well..kmemsize is kernel memory. If you'll take a look at a post I just responded to above yours.."..Is this overload?"..you'll understand a bit more. It is a very complex subject..and I believe some hosts don't have a clue what "Fair" allocations are at all. According to everything I have read on openvz's website..a VPS should have 17-15% of the RAm allocated to the kernel. Some don't..not even close...I've seen as low as 2%...which simply does not work very well.

    Add Cpanel as many hosts do...and you've got *serious* problems...due to the resources it uses running all those secondary programs.

    If you really want to understand more...login with SSH and run the following commands:

    cat /proc/user_beancounters

    and

    ps axfuw

    If the server is actually serving web pages when you do this...we may be able to track down exactly what is using all the kmem and..if your vps is setup correctly.
    many VPS's are not setup correctly...and the problems that result have nothing to do with what the vps user is doing at all.

    If you post the output from these two commands..I may be able to help you clear up the problem.

    Bryon
    Bryon L Harvey
    Soil Relocation Engineer

  7. #7

    Question

    Quote Originally Posted by bryonhost1
    Hi!
    Well...take a look at good ole beanconters (if openvz or virtuozzo) by:

    cat proc/user_beancounters

    Feel free to post the output here...and I'll be more than happy to explain what those numbers mean. Yes..I am working on a FAQ for this...very common questions!

    Bryon
    uid resource held maxheld barrier limit failcnt
    113: kmemsize 4701999 4719496 15728640 15728640 4998864
    lockedpages 0 0 256 256 0
    privvmpages 52578 52587 131072 327680 0
    shmpages 731 731 21504 21504 0
    dummy 0 0 0 0 0
    numproc 75 75 1000 1000 0
    physpages 37553 37554 0 2147483647 0
    vmguarpages 0 0 65536 2147483647 0
    oomguarpages 38941 38942 54272 2147483647 0
    numtcpsock 32 32 1000 1000 0
    numflock 11 11 188 206 35
    numpty 1 1 16 16 0
    numsiginfo 0 0 256 256 0
    tcpsndbuf 11140 11140 3440640 3440640 0
    tcprcvbuf 0 692 3440640 3440640 0
    othersockbuf 30320 30320 2252160 2252160 0
    dgramrcvbuf 0 0 267144 267144 193
    numothersock 26 26 1000 1000 0
    dcachesize 533222 534944 3575808 3575808 0
    numfile 1510 1511 9312 9312 0
    dummy 0 0 0 0 0
    dummy 0 0 0 0 0
    dummy 0 0 0 0 0
    numiptent 14 14 128 128 0

  8. #8
    Join Date
    Dec 2004
    Location
    Butler,TN
    Posts
    2,413
    Hi!
    Just out of curiosity..what RAM size is this VPS?

    This is the first time I've seen every resource except for kernel memory running into the wall..and run into wall it has been..ouch..4998864 times, in fact.

    Ok..here's what the numbers tell me:

    VPS RAM=65536 2147483647 = 256MB/?
    VPS RAM Burst=131072 327680 = 512MB/1280MB
    Kernel memory=15728640 15728640 = 15MB

    The problem is clear..this VPS is incorrectly setup.

    Tell your host to take a look at this thread..or paste it to them in an email.
    kmem needs to be at least 10% of RAM...25MB Kernel memory. Openvz recommends 17%-~44MB allocated to the kernel..which is: 46137344

    Ask them to fix it...if they don't ...I would move on.

    Bryon
    Bryon L Harvey
    Soil Relocation Engineer

  9. #9

    Question what is numiptent

    Quote Originally Posted by bryonhost1
    Hi!
    Just out of curiosity..what RAM size is this VPS?

    This is the first time I've seen every resource except for kernel memory running into the wall..and run into wall it has been..ouch..4998864 times, in fact.

    Ok..here's what the numbers tell me:

    VPS RAM=65536 2147483647 = 256MB/?
    VPS RAM Burst=131072 327680 = 512MB/1280MB
    Kernel memory=15728640 15728640 = 15MB

    The problem is clear..this VPS is incorrectly setup.

    Tell your host to take a look at this thread..or paste it to them in an email.
    kmem needs to be at least 10% of RAM...25MB Kernel memory. Openvz recommends 17%-~44MB allocated to the kernel..which is: 46137344

    Ask them to fix it...if they don't ...I would move on.

    Bryon
    what RAM size is this VPS? 256

    what is numiptent?
    becuse it is failcnt that make me feel worry
    please help me that

    thanks in advanced for your help

    regards

    red fox

  10. #10
    Here is mine. Dotster VPS
    50gig HDD - 256mb RAM - Dual Xeon
    Virtuozzo - cPanel 11

    PHP Code:
    Version2.5                                                                   
           uid  resource           held    maxheld    barrier      limit    failcnt
          3593
    kmemsize       11440503   11880019   16384000   18022400     241524
                lockedpages           0          0       4096       4096          0
                privvmpages      128286     131218     262144     292912          0
                shmpages            859        859     131072     131072          0
                dummy                 0          0          0          0          0
                numproc             133        136        400        400          0
                physpages        102367     104364          0 2147483647          0
                vmguarpages           0          0          0 2147483647          0
                oomguarpages     102367     104364          0 2147483647          0
                numtcpsock           43         51        500        500          0
                numflock             11         14        200        220          0
                numpty                1          1         64         64          0
                numsiginfo            0          2        512        512          0
                tcpsndbuf        658084     721392    5365760   10485760          0
                tcprcvbuf        612916     664304    5365760   10485760          0
                othersockbuf      43592      60164    1503232    4063232          0
                dgramrcvbuf           0       2236     262144     262144          0
                numothersock         38         42        500        500          0
                dcachesize      1275367    1298927    4192304    4317184          0
                numfile            5345       5439       8192       8192          0
                dummy                 0          0          0          0          0
                dummy                 0          0          0          0          0
                dummy                 0          0          0          0          0
                numiptent            71         71        128        128          0 
    Is my Kmem allocated correctly? I'm constantly exceeding mine.

  11. #11
    Join Date
    Jul 2006
    Posts
    266
    When ever i have problems with kmemsize is usually when i have too many apache childs running, for example when mysql is taking too long to make some queries and apache is trying to handle the incomming connections it can start spawning lots of childs and thats when it hits the kmemsize wall.

    Also when im sending too many emails, for example the monthly newsletter, if some mails fail and the server keeps trying to send them.

    Those are the 2 main reasons, i have a 14 000 000 limit so your kmemsize is more than what i have.

  12. #12
    I actually have 512mb not 256.

  13. #13
    I know this is a super old thread, but I'm having problems with my VPS too. kmemsize switches every 4 minutes from yellow to green, sometimes red. My website is almost dead. I have to reboot my container all the time.

    Here's my file.
    Version: 2.5
    uid resource held maxheld barrier limit failcnt
    67964151: kmemsize 19414362 20238336 41943040 50331648 0
    lockedpages 0 0 512 512 12
    privvmpages 104216 106135 1048576 1153433 0
    shmpages 1092 1092 32768 32768 0
    dummy 0 0 9223372036854775807 9223372036854775807 0
    numproc 55 75 256 256 0
    physpages 56164 59017 1048576 1048576 0
    vmguarpages 0 0 524288 524288 0
    oomguarpages 39329 39948 524288 524288 0
    numtcpsock 25 26 720 720 0
    numflock 12 13 376 413 0
    numpty 1 1 32 32 0
    numsiginfo 0 15 512 512 0
    tcpsndbuf 403432 420872 3440640 5406720 0
    tcprcvbuf 409600 425984 3440640 5406720 0
    othersockbuf 171088 181080 2252160 4194304 0
    dgramrcvbuf 0 0 524288 576716 0
    numothersock 148 150 720 720 0
    dcachesize 8647817 8690253 9223372036854775807 9223372036854775807 0
    numfile 1438 1480 8192 8192 0
    dummy 0 0 9223372036854775807 9223372036854775807 0
    dummy 0 0 9223372036854775807 9223372036854775807 0
    dummy 0 0 9223372036854775807 9223372036854775807 0
    numiptent 51 51 200 205 0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •