Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Page 1 of 2 12 LastLast
Results 1 to 15 of 20

This is a discussion on Am I a Resource Hog? in the Shared & Semi-Dedicated forum
I was thinking of titling this post "Am I a scum bag", but this title is a more accurate one =) I'm wondering how I ...

  1. #1
    Loyal Client
    Join Date
    Jan 2005
    Posts
    159

    Am I a Resource Hog?

    I was thinking of titling this post "Am I a scum bag", but this title is a more accurate one =)

    I'm wondering how I can tell how much server resources my sites are using. So I know I'm using about 24 GB/month bandwidth, 10,000 visits/day, and 2.5 GB of disk space. But I have no idea how much CPU and memory I'm using.

    My software is almost all written by myself, so I'm not sure if it as using as many resources as a forum (which I've heard are resource-intense). The main package is about 1 mb or so of PHP code, and generally runs 1-5 mysql queries per page (all of which are optimized pretty well). Most of my databases are pretty small (0-6 mb) -- which would affect how much memory I'd be using if Mysql caches the indexes.

    There is the one 400mb database (top secret), but it isn't used much (currently only a couple times per day).

    So is there any way to tell how much memory and/or CPU I'm using?

  2. #2
    the Windlord Gwaihir's Avatar
    Join Date
    Jun 2002
    Posts
    2,562
    No, AFAIK you can't really tell. I've been wondering this myself and even asked support about it once. Unless you put yourself up your own testing machine back home and simulate, there's no solid load monitoring tools available to you. (You can to some extend monitor the server, but there's no way to tell how much of what you see is you.)

    Sounds like you've got it covered pretty well already though. For example: IIRC last time I looked at a PHP-Nuke page it had some note near the bottom that over 100 queries were made to built up that page. That PHP-Nuke is still accepted around here, so do the math.
    Regards,

    Wim Heemskerk
    ---
    Visit MeCCG.net - Cardgaming in J.R.R. Tolkien's Middle-earth
    And Gwaihir.net - The Middle-earth CCG store

  3. #3
    Loyal Client
    Join Date
    Jan 2005
    Posts
    159
    I'm wondering if I could run top as a cron job and if that would help figure it out? I'm not unix expert. In jail shell we normally don't have access to top, but you can do a lot of things with cron jobs (they have higher permissions).

  4. #4
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,307
    OOOooooo can I look at your top secret database? Does it have all sorts of illegal things! You've got my attention!

  5. #5
    the Windlord Gwaihir's Avatar
    Join Date
    Jun 2002
    Posts
    2,562
    Quote Originally Posted by akreider2
    but you can do a lot of things with cron jobs (they have higher permissions).
    They do run as 'you' as well, right? But they have a bash shell instead of a jail shell, or something like that?
    Regards,

    Wim Heemskerk
    ---
    Visit MeCCG.net - Cardgaming in J.R.R. Tolkien's Middle-earth
    And Gwaihir.net - The Middle-earth CCG store

  6. #6
    Friendly rainboy's Avatar
    Join Date
    Apr 2006
    Location
    Eindhoven, The Netherlands
    Posts
    546
    Top can even work in a jail shell. If they let you access it that is.

    I can think of reasons why you would not want that, but are you sure its blocked, on a default jail-shell on a cpanel server it is not.

    What exactly do you mean with 'higher permission'

    why not run a cronjob looking at your 'ps aux' stats (if available in you jail) and making a log file from it .. something like

    1,16,31,46 * * * * /bin/ps aux >> /somewhere/logfile

    and let that run for some time, does the same as top but outputs its resources every 15 minutes (could be faster if you like, but i like to sample in 15 minutes intervals first). And do that for some time to see if you have any spikes. Then focus on that time to take a closer look. Being carefull that your ps doesnt get all the resources though

    Good luck,

    Patrick

  7. #7
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    Quote Originally Posted by Gwaihir
    They do run as 'you' as well, right? But they have a bash shell instead of a jail shell, or something like that?
    Its not really a case of higher permissions, its that cron jobs do run as "you," so its your permissions instead of the nobody user's.

    I know crons used to run under bash instead of JailShell, but that may have changed in recent times. I haven't checked lately.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  8. #8
    the Windlord Gwaihir's Avatar
    Join Date
    Jun 2002
    Posts
    2,562
    rainboy: I'm speaking specifically of the (jail) shell configuration JagPC offers us SSH too. top and ps are both blocked in that, as are a few more tools that could tell about system load and what load you're causing. I assume there are security related reasons for doing this but I have never seen them posted.

    Jason: when I try to peek at load from the jailshell, I am 'me' too, no?
    Regards,

    Wim Heemskerk
    ---
    Visit MeCCG.net - Cardgaming in J.R.R. Tolkien's Middle-earth
    And Gwaihir.net - The Middle-earth CCG store

  9. #9
    Friendly rainboy's Avatar
    Join Date
    Apr 2006
    Location
    Eindhoven, The Netherlands
    Posts
    546
    Gwaihir,

    I saw an other user using a shared hosting account and being able to use top on his system. So apperently JPC does have different policies on different boxes in regard to the 'top' tool.

    Reason why you do not want those tools running is that probably because you can see how much other users are using, but you are also aware of the usernames on the system. Also you will be able to see which tools are running on the server and where they are exactly located. It might give customers more questions as it really gives answers.

    Kind regards,
    Patrick

  10. #10
    the Windlord Gwaihir's Avatar
    Join Date
    Jun 2002
    Posts
    2,562
    Quote Originally Posted by rainboy
    I saw an other user using a shared hosting account and being able to use top on his system. So apperently JPC does have different policies on different boxes in regard to the 'top' tool.
    The policy is consistent enough, I think. Here and there, there's probably an (older) box on which it has never been fully implemented.

    The privacy thingy is probably the main argument. I don't see how 'giving questions' is. You sure don't mean to imply one would already know everything else?
    Last edited by Gwaihir; 05-10-2006 at 04:18 PM.
    Regards,

    Wim Heemskerk
    ---
    Visit MeCCG.net - Cardgaming in J.R.R. Tolkien's Middle-earth
    And Gwaihir.net - The Middle-earth CCG store

  11. #11
    Loyal Client
    Join Date
    Jan 2005
    Posts
    159
    I tried ps aux. The problem is that most of the processes are identified as "nobody" (for apache) or "mysql" for mysql, or something else for mail. The only thing I see as "campusac" (me) is php files or shell commands.

    Hmm, does this mean someone has been running "nano" (apparently a text editor) for the past 530 minutes, and is eating up 63.2% of the CPU?!?

    2006-05-10 19:08:23.109 32333 13227 63.2 0.0 3036 816 ? R 05:09 530:33 nano

    The server load (chameleon) is over 7.

  12. #12
    Friendly rainboy's Avatar
    Join Date
    Apr 2006
    Location
    Eindhoven, The Netherlands
    Posts
    546
    Gwaihir,

    The questions.. look at post 11

    thats what i mean, someone sees a process using loads of CPU (could be well a crashed nano though) and starts to ask questions to support to fix it.

    While if the server would be monitored they should already be triggered by such a process running that long and they should be working on it. Tickets from all kind of clients assuming that something is wrong would only delay solving the problems. (but i assume they monitor the shared servers for this kind of 'issues', I may be completely wrong with my assumption )

    On a side note : A load over 7 doesn't have to hurt, it depends on how many processors are in the machine, if you got 8 processors its not even over 1 in total.

    Kind regards,
    Patrick

  13. #13
    Loyal Client
    Join Date
    Jan 2005
    Posts
    159
    Jaguar claims "Powerful Dual Processor Servers". Sounds like 2 processors to me.

    3:40am (EST time) and load is still 6.5. Nano is still running, and taking 64% of cpu (800 minutes!). I've been trying to leave support alone for the past couple days, to let them focus on fixing chameleon, but i'm beginning to wonder if I should file a ticket.

    Aaron

  14. #14
    Friendly rainboy's Avatar
    Join Date
    Apr 2006
    Location
    Eindhoven, The Netherlands
    Posts
    546
    alreider2,

    I would at least let them know that nano is using so much, its probably a hanging process. did have it once with vi ... doesnt seem applications who can crash and use a lot of CPU, but apperently they can guess they come in some kind of loop.

    So if its a 2 processor system devide the CPU load by 2

    Chances are they are just not aware of it.

    Kind regards,
    Patrick

  15. #15
    Loyal Client
    Join Date
    Jan 2005
    Posts
    159
    I did and they shut it down. Load is down to 3.5.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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