GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Virtual Priver Server Problem - High CPU Resourcess Usage (https://gfy.com/showthread.php?t=1084916)

lakerslive 10-11-2012 09:31 AM

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 10-11-2012 09:32 AM

Do you run Wordpress?

blazin 10-11-2012 09:49 AM

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)

lakerslive 10-11-2012 09:57 AM

i run custom made script

lakerslive 10-11-2012 09:58 AM

Quote:

Originally Posted by blazin (Post 19245153)
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.

GMelanie 10-11-2012 10:09 AM

Quote:

Originally Posted by lakerslive (Post 19245116)
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 10-11-2012 10:14 AM

Quote:

Originally Posted by lakerslive (Post 19245173)
i run custom made script

LAMP Stack (PHP?), Perl, Python, Ruby on Rails, Customized Wordpress?

lakerslive 10-11-2012 10:16 AM

Quote:

Originally Posted by GMelanie (Post 19245224)
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 10-11-2012 10:20 AM

Quote:

Originally Posted by blazin (Post 19245153)
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?

GMelanie 10-11-2012 10:26 AM

Quote:

Originally Posted by lakerslive (Post 19245240)
Is there a way to stress test a script without having visitors?

Yes, with synthetic web transactions.

CYF 10-11-2012 11:42 AM

Quote:

Originally Posted by lakerslive (Post 19245179)
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.

lakerslive 10-11-2012 12:17 PM

Quote:

Originally Posted by CYF (Post 19245450)
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?

facialfreak 10-11-2012 12:33 PM

Quote:

Originally Posted by GMelanie (Post 19245208)
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.

facialfreak 10-11-2012 12:36 PM

Quote:

Originally Posted by lakerslive (Post 19245240)
Is there a way to stress test a script without having visitors?

www.loadimpact.com

Denny 10-11-2012 12:43 PM

Quote:

Originally Posted by lakerslive (Post 19245179)
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? :error

grumpy 10-11-2012 12:45 PM

not enough info but your script might be the number one problem. What kind of site is it, db involved?

lakerslive 10-11-2012 01:23 PM

Quote:

Originally Posted by facialfreak (Post 19245581)
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?

RandyD 10-11-2012 01:35 PM

Hostgaor is your problem - they've always capped cpu usage, forcing upgrades - get a decent vps.

lakerslive 10-11-2012 01:49 PM

Quote:

Originally Posted by lakerslive (Post 19245706)
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?

cruxop 12-08-2012 02:00 AM

Quote:

Originally Posted by lakerslive (Post 19245179)
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. :)

AndrewX 12-08-2012 05:13 AM

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'?

VenusBlogger 12-08-2012 05:52 AM

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

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

Post the values.

woj 12-08-2012 07:16 AM

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... :2 cents:


All times are GMT -7. The time now is 12:32 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123