Virtual Priver Server Problem - High CPU Resourcess Usage

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lakerslive
    Confirmed User
    • Aug 2012
    • 929

    #1

    Virtual Priver Server Problem - High CPU Resourcess Usage

    Guys,

    1. is it better to fix script or move into dedicated server?
    2. How do I find my CPU resource usage via cpanel?
    3. What is a safe CPU resource usage?
    Thanks
  • wehateporn
    Promoting Debate on GFY
    • Apr 2007
    • 27176

    #2
    Do you run Wordpress?

    Comment

    • blazin
      Confirmed User
      • Aug 2002
      • 2781

      #3
      1) Perform optimisation if possible.. if you do have issue with lack of CPU within applications but have lots of memory you can do lot's of caching at various points within the stack to alleviate that.
      2) Don't know.. if you have shell access use htop to check live resource usage
      3) Depends on what application your running, ideally you'd want total CPU usage less than 100% at peak (by a decent margin)
      I don't endorse a god damn thing......

      Comment

      • lakerslive
        Confirmed User
        • Aug 2012
        • 929

        #4
        i run custom made script

        Comment

        • lakerslive
          Confirmed User
          • Aug 2012
          • 929

          #5
          Originally posted by blazin
          1) Perform optimisation if possible.. if you do have issue with lack of CPU within applications but have lots of memory you can do lot's of caching at various points within the stack to alleviate that.
          2) Don't know.. if you have shell access use htop to check live resource usage
          3) Depends on what application your running, ideally you'd want total CPU usage less than 100% at peak (by a decent margin)
          1. Is there a limit to code optimization?

          My site gets 35k hits avg. How is it sites like youporn can receive millions of hits and not have server problem.. jeez. im always hitting a wall.

          Comment

          • GMelanie
            Registered User
            • Oct 2010
            • 6

            #6
            Originally posted by lakerslive
            Guys,
            1. is it better to fix script or move into dedicated server?
            It's always better to find out what the problem is, most likely your "script" whatever
            that software is, is not letting go of native OS resources, like database handles, file handles etc.. or is doing something inefficient with SQL or files etc.. It is found that if you have to throw hardware at the problem, you delay the inevitable, throwing more hardware at the problem (unless you have a very special case).

            2. How do I find my CPU resource usage via cpanel?
            You don't, you make a shell account on the box and use standard profiling tools, top, sar, ps, uptime come to mind at first. Non withstanding code profiling tools to see speed of execution etc, per DB call, per script call, per page render.

            3. What is a safe CPU resource usage?
            Thanks
            Less than %65 percent of all total, above this number the OS starts to struggle with opening new connections, swapping and opening files, so the effect is compound at about an x(squared) after that, where each subsequent request eats more and more until peak %100 is unresponsive.

            Comment

            • GMelanie
              Registered User
              • Oct 2010
              • 6

              #7
              Originally posted by lakerslive
              i run custom made script
              LAMP Stack (PHP?), Perl, Python, Ruby on Rails, Customized Wordpress?

              Comment

              • lakerslive
                Confirmed User
                • Aug 2012
                • 929

                #8
                Originally posted by GMelanie
                LAMP Stack (PHP?), Perl, Python, Ruby on Rails, Customized Wordpress?
                php. Nothing close to wordpress. It's not even a commercial script. It's a script just for me.

                Comment

                • lakerslive
                  Confirmed User
                  • Aug 2012
                  • 929

                  #9
                  Originally posted by blazin
                  1) Perform optimisation if possible.. if you do have issue with lack of CPU within applications but have lots of memory you can do lot's of caching at various points within the stack to alleviate that.
                  2) Don't know.. if you have shell access use htop to check live resource usage
                  3) Depends on what application your running, ideally you'd want total CPU usage less than 100% at peak (by a decent margin)

                  Is there a way to stress test a script without having visitors?

                  Comment

                  • GMelanie
                    Registered User
                    • Oct 2010
                    • 6

                    #10
                    Originally posted by lakerslive
                    Is there a way to stress test a script without having visitors?
                    Yes, with synthetic web transactions.

                    Comment

                    • CYF
                      Coupon Guru
                      • Mar 2009
                      • 10973

                      #11
                      Originally posted by lakerslive
                      1. Is there a limit to code optimization?

                      My site gets 35k hits avg. How is it sites like youporn can receive millions of hits and not have server problem.. jeez. im always hitting a wall.
                      youporn doesn't run on a VPS.

                      Is that 35k hits a day? It's probably time to move to a dedicated server if that's the case.
                      Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
                      AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons

                      Comment

                      • lakerslive
                        Confirmed User
                        • Aug 2012
                        • 929

                        #12
                        Originally posted by CYF
                        youporn doesn't run on a VPS.

                        Is that 35k hits a day? It's probably time to move to a dedicated server if that's the case.
                        Yes, hostgator has max 25% CPU usage for VPS..

                        How much CPU usage do you guys use up?

                        Comment

                        • facialfreak
                          Confirmed User
                          • Feb 2005
                          • 3018

                          #13
                          Originally posted by GMelanie
                          Less than %65 percent of all total, above this number the OS starts to struggle with opening new connections, swapping and opening files, so the effect is compound at about an x(squared) after that, where each subsequent request eats more and more until peak %100 is unresponsive.
                          Not exactly true ... Apache 2.x will try to use up to 95% of your available resources at any given time ... and if your scripts are running fine, this is generally not a problem.

                          The more important thing to monitor, is the amount of SWAP that is available ...

                          Once you run out of SWAP, is when your server will start to bog down, connections will time out, it will start to seem unresponsive, and your load averages will begin to escalate quickly.

                          When you see this beginning to happen - before it gets too out of hand - you can log into shell and run "top" to see what exactly is pulling your resources, and will give you a place to start in troubleshooting your issues.

                          What type of a custom script are you running? Is it a scraping type of script? If so, an upgrade to a dedicated server (or a much beefier VPS at least) is probably in your near future, as scraper type scripts are very resource intensive, and depending on how many queries it is performing at a time, will quickly chew through the resources of a basic VPS.
                          Last edited by facialfreak; 10-11-2012, 11:34 AM.

                          Managed Shared Hosting starting at $4.99/mo
                          Managed VPS starting at $29.99/mo


                          Comment

                          • facialfreak
                            Confirmed User
                            • Feb 2005
                            • 3018

                            #14
                            Originally posted by lakerslive
                            Is there a way to stress test a script without having visitors?
                            www.loadimpact.com

                            Managed Shared Hosting starting at $4.99/mo
                            Managed VPS starting at $29.99/mo


                            Comment

                            • Denny
                              Too lazy to set a custom title
                              • Feb 2005
                              • 17393

                              #15
                              Originally posted by lakerslive
                              My site gets 35k hits avg. How is it sites like youporn can receive millions of hits and not have server problem.. jeez. im always hitting a wall.
                              Do you realize those big tubes need hundreds of servers?

                              Comment

                              • grumpy
                                Too lazy to set a custom title
                                • Jan 2002
                                • 9870

                                #16
                                not enough info but your script might be the number one problem. What kind of site is it, db involved?
                                Don't let greediness blur your vision | You gotta let some shit slide
                                icq - 441-456-888

                                Comment

                                • lakerslive
                                  Confirmed User
                                  • Aug 2012
                                  • 929

                                  #17
                                  Originally posted by facialfreak
                                  Not exactly true ... Apache 2.x will try to use up to 95% of your available resources at any given time ... and if your scripts are running fine, this is generally not a problem.

                                  The more important thing to monitor, is the amount of SWAP that is available ...

                                  Once you run out of SWAP, is when your server will start to bog down, connections will time out, it will start to seem unresponsive, and your load averages will begin to escalate quickly.

                                  When you see this beginning to happen - before it gets too out of hand - you can log into shell and run "top" to see what exactly is pulling your resources, and will give you a place to start in troubleshooting your issues.

                                  What type of a custom script are you running? Is it a scraping type of script? If so, an upgrade to a dedicated server (or a much beefier VPS at least) is probably in your near future, as scraper type scripts are very resource intensive, and depending on how many queries it is performing at a time, will quickly chew through the resources of a basic VPS.
                                  its not a scraper. I simply embed videos from tube sites manually and write about each one. So.. what do you think of the future of that in terms of CPU usage?

                                  Comment

                                  • RandyD
                                    Confirmed User
                                    • May 2007
                                    • 283

                                    #18
                                    Hostgaor is your problem - they've always capped cpu usage, forcing upgrades - get a decent vps.
                                    Brutal Bucks - Extreme sites that STILL sell

                                    Comment

                                    • lakerslive
                                      Confirmed User
                                      • Aug 2012
                                      • 929

                                      #19
                                      Originally posted by lakerslive
                                      its not a scraper. I simply embed videos from tube sites manually and write about each one. So.. what do you think of the future of that in terms of CPU usage?
                                      i got this from hostagor for my VPS server.
                                      " your VPS is hovering between 64% and 99% idle with most usage"

                                      Not good huh?
                                      Last edited by lakerslive; 10-11-2012, 12:53 PM.

                                      Comment

                                      • cruxop
                                        Registered User
                                        • Aug 2007
                                        • 61

                                        #20
                                        Originally posted by lakerslive
                                        1. Is there a limit to code optimization?

                                        My site gets 35k hits avg. How is it sites like youporn can receive millions of hits and not have server problem.. jeez. im always hitting a wall.
                                        YouPorn has more than one server. They likely have dozens of them.

                                        Comment

                                        • AndrewX
                                          Confirmed User
                                          • Jan 2004
                                          • 574

                                          #21
                                          How do you know you have high resource usage? Most likely it's just memory related.

                                          cPanel eats a lot of ram, CentOS eats also a lot more than Debian for example, and cPanel only runs on it. I would suggest moving to a control panel with a lower memory footprint. Or no control panel at all, a managed solution.

                                          HostGator's site is down for me, but I believe their VPS is OpenVZ, it's not real full virtualization, you don't have swap either. XEN VPS would work better for your needs.

                                          You could let someone take a look at your MySQL and optimize it. Maybe upgrade to PHP 5.4, it improves memory footprint and is MUCH faster than 5.3. Is it out yet for cPanel, or do they still claim it's 'experimental'?

                                          █ ► XenLayer - Paravirtualization Professionals since 2008 - [ICQ: 297820698]
                                          █ ► Reseller Hosting | OpenVZ VPS | XEN VPS | Dedicated Servers

                                          Comment

                                          • VenusBlogger
                                            So Fucking Banned
                                            • Nov 2011
                                            • 1540

                                            #22
                                            Enter via SSH and type "top" to see the activity.

                                            Then type "free -m" to see memory usage.

                                            Post the values.

                                            Comment

                                            • woj
                                              <&(©¿©)&>
                                              • Jul 2002
                                              • 47882

                                              #23
                                              35k/day isn't much at all, most likely there is some flaw in the script... if the script is poorly designed it will only get worse and worse as you add more content and/or traffic, and you will have to revisit this same problem every few months... it will be cheaper long term to just fix the script...
                                              Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
                                              Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
                                              Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

                                              Comment

                                              Working...