Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 10-11-2012, 09:31 AM   #1
lakerslive
Confirmed User
 
Industry Role:
Join Date: Aug 2012
Posts: 929
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
lakerslive is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2012, 09:32 AM   #2
wehateporn
Promoting Debate on GFY
 
wehateporn's Avatar
 
Industry Role:
Join Date: Apr 2007
Posts: 27,173
Do you run Wordpress?
__________________
wehateporn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2012, 09:49 AM   #3
blazin
Confirmed User
 
Join Date: Aug 2002
Posts: 2,781
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......
blazin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2012, 09:57 AM   #4
lakerslive
Confirmed User
 
Industry Role:
Join Date: Aug 2012
Posts: 929
i run custom made script
lakerslive is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2012, 09:58 AM   #5
lakerslive
Confirmed User
 
Industry Role:
Join Date: Aug 2012
Posts: 929
Quote:
Originally Posted by blazin View Post
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.
lakerslive is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2012, 10:09 AM   #6
GMelanie
Registered User
 
Industry Role:
Join Date: Oct 2010
Posts: 6
Quote:
Originally Posted by lakerslive View Post
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).

Quote:
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.

Quote:
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.
GMelanie is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2012, 10:14 AM   #7
GMelanie
Registered User
 
Industry Role:
Join Date: Oct 2010
Posts: 6
Quote:
Originally Posted by lakerslive View Post
i run custom made script
LAMP Stack (PHP?), Perl, Python, Ruby on Rails, Customized Wordpress?
GMelanie is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2012, 10:16 AM   #8
lakerslive
Confirmed User
 
Industry Role:
Join Date: Aug 2012
Posts: 929
Quote:
Originally Posted by GMelanie View Post
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.
lakerslive is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2012, 10:20 AM   #9
lakerslive
Confirmed User
 
Industry Role:
Join Date: Aug 2012
Posts: 929
Quote:
Originally Posted by blazin View Post
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?
lakerslive is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2012, 10:26 AM   #10
GMelanie
Registered User
 
Industry Role:
Join Date: Oct 2010
Posts: 6
Quote:
Originally Posted by lakerslive View Post
Is there a way to stress test a script without having visitors?
Yes, with synthetic web transactions.
GMelanie is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2012, 11:42 AM   #11
CYF
Coupon Guru
 
CYF's Avatar
 
Industry Role:
Join Date: Mar 2009
Location: Minneapolis
Posts: 10,973
Quote:
Originally Posted by lakerslive View Post
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

CYF is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2012, 12:17 PM   #12
lakerslive
Confirmed User
 
Industry Role:
Join Date: Aug 2012
Posts: 929
Quote:
Originally Posted by CYF View Post
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?
lakerslive is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2012, 12:33 PM   #13
facialfreak
Confirmed User
 
facialfreak's Avatar
 
Join Date: Feb 2005
Location: Montreal
Posts: 3,018
Quote:
Originally Posted by GMelanie View Post
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.
__________________

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



Last edited by facialfreak; 10-11-2012 at 12:34 PM..
facialfreak is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2012, 12:36 PM   #14
facialfreak
Confirmed User
 
facialfreak's Avatar
 
Join Date: Feb 2005
Location: Montreal
Posts: 3,018
Quote:
Originally Posted by lakerslive View Post
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


facialfreak is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2012, 12:43 PM   #15
Denny
Too lazy to set a custom title
 
Denny's Avatar
 
Industry Role:
Join Date: Feb 2005
Posts: 17,260
Quote:
Originally Posted by lakerslive View Post
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?
__________________
Denny is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2012, 12:45 PM   #16
grumpy
Too lazy to set a custom title
 
grumpy's Avatar
 
Join Date: Jan 2002
Location: Holland
Posts: 9,870
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
grumpy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2012, 01:23 PM   #17
lakerslive
Confirmed User
 
Industry Role:
Join Date: Aug 2012
Posts: 929
Quote:
Originally Posted by facialfreak View Post
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?
lakerslive is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2012, 01:35 PM   #18
RandyD
Confirmed User
 
Join Date: May 2007
Posts: 283
Hostgaor is your problem - they've always capped cpu usage, forcing upgrades - get a decent vps.
__________________
Brutal Bucks - Extreme sites that STILL sell
RandyD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2012, 01:49 PM   #19
lakerslive
Confirmed User
 
Industry Role:
Join Date: Aug 2012
Posts: 929
Quote:
Originally Posted by lakerslive View Post
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 at 01:53 PM..
lakerslive is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-08-2012, 02:00 AM   #20
cruxop
Registered User
 
Industry Role:
Join Date: Aug 2007
Location: USA
Posts: 61
Quote:
Originally Posted by lakerslive View Post
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.
cruxop is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-08-2012, 05:13 AM   #21
AndrewX
Confirmed User
 
AndrewX's Avatar
 
Industry Role:
Join Date: Jan 2004
Posts: 574
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
AndrewX is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-08-2012, 05:52 AM   #22
VenusBlogger
So Fucking Banned
 
Industry Role:
Join Date: Nov 2011
Posts: 1,540
Enter via SSH and type "top" to see the activity.

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

Post the values.
VenusBlogger is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-08-2012, 07:16 AM   #23
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
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
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.