Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


KVM VPS 1 CPU Hight Load
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

KVM VPS 1 CPU Hight Load

jure12jure12 Member
edited December 2018 in Requests

Helo,
I have VPS 1 CPU, 2 GB Ram and I have problem with hight load, please see my picture:

If I bought a VPS with 2 CPUs, would I have a smaller CPU load?

«1

Comments

  • dedotatedwamdedotatedwam Member
    edited December 2018

    You need to optimize whatever the hell you're running with php.

    You'll have the same load, but more resources. Depending on the host, maximizing your CPU's could be grounds for service termination.

  • jure12jure12 Member
    edited December 2018

    I forgot to say the load is not always height, only 3-4 hours daily is height.
    I have KVM VPS with OVH.

    EDIT:
    I want to add that I have a good day's visits.

  • What’s happening in those 3-4 hours each day?

  • jure12jure12 Member
    edited December 2018

    @LeonDynamic said:
    What’s happening in those 3-4 hours each day?

    That's 3-4 hours a day It's time in my state when the "whole world" is free, this is about 20:00, 21:00, 22:00 in the evening, means when most people are free with time.

  • So, you didn't even bother checking to see what Apache is doing before posting a thread?

  • I did not understand you.

    If I buy a VPS with 2 cpu, I will have a smaller load ?

  • MikeAMikeA Member, Patron Provider

    @jure12 said:
    I did not understand you.

    If I buy a VPS with 2 cpu, I will have a smaller load ?

    not if whatever you're running through PHP is poorly written, or if you have a ton of traffic.

  • I think it's a traffic problem in my case. Now that it's in my state 2:25 AM in the morning look at my CPU load:

    It looks like traffic is a problem.

  • MikeAMikeA Member, Patron Provider
    edited December 2018

    @jure12 said:
    I think it's a traffic problem in my case. Now that it's in my state 2:25 AM in the morning look at my CPU load:

    It looks like traffic is a problem.

    Only way to tell is to check your access log if you have it set to log. Either way, if so whatever you run that is PHP is either not efficient, or it is just too much traffic for a small 1 core VPS. Might be worthwhile to update PHP if you're on an older version too.

    Thanked by 2coreflux tcp6
  • use top
    maybe the steal time up to 99% :lol:

  • I mean it before it is just too much traffic for a small 1 core VPS

  • bcacbbcacb Member
    edited December 2018

    246 MB of resident memory for each Apache process is a lot. Have you tried running Apache with event instead of prefork to help prevent high memory?

  • @bcacb said:
    246 MB of resident memory for each Apache process is a lot. Have you tried running Apache with event instead of prefork to help prevent high memory?

    I have optimized Apache with 'keep-alive'.
    I think I have too many visits.

  • bump

  • What is the server doing? Check your access.log or error.log files and see what pages are being frequently accessed. Perhaps it's some automatic task (backups? optimization? caching?)

    Are you running some sort of CMS or other pre-made platform?

    What are your server specs? They might just be too low.

    Upgrading to a better server could solve your stuff, but throwing more resources at badly optimized code it's not a good solution. Check your scripts.

  • I've looked at this case a bit and the problem is when I have a big web visit cpu load jump around 1.5 - 2.2

    Normally it works around 0.40 - 0.70

  • jvnadrjvnadr Member
    edited December 2018

    At first, you don't know how to use a vps. I assume you host a live site there. DON'T.
    Pay more and use a managed service. You can't handle even the basics, how do you expect to react when your server will be hacked, have a malicious code, your MySQL corrupts, your server collapse or start sending tons of spam or DDoS attacks?
    Have you hardened your server? Did you disable root ssh access, did you setup keys, did you configure any firewall there?
    A VPS is not just setting up something vesta on it and wait to work.

    On topic now, your vps is probably weak to receive certain amount of traffic over a limit. I assume you have a CMS on it, probably Wordpress or something similar, with plugins. So, when you gain more visitors, they open a lot more of http pages and php-fpm instances than when the load is low.

    • Have you monitored the traffic to see how many live visitors are there when the CPU goes high? Have you investigate what script/page(s) is causing the php-fpm instances?
    • I guess you have not optimized anything there. Do you cache static files and your CMS? Or every time a visitor opens your first page, this page is being created from the beginning?
    • Do you minimize and cache js/css? Do you use any CDN with caching options to reduce load from the server? Have you optimized MySQL? What kind of tables do you use? INNO?
    • What optimization have you done in your PHP? How many worker connections do you allow?
    • Have you installed any proxy server like nginx to use it for static/cached files? Or you are using plain apache?
    • Have you checked your HDD? Is there any iowait? If yes, this will also cause load and delay.

    Bottomline:
    There are lot of things you can do to optimize your server. Can you understand what I wrote before? If not, move your site to a managed vps of, if this is too expensive for you, move it to a good shared hosting provider. You will have much more optimized performance, due to the optimized server, the usage of litespeed server, the caching etc. But again, you will have there also to optimize your site.

  • @jvnadr said:

    this! all of it.

    probably just a poorly coded plugin that does too much ajax calls which utilize php/mysql for nothing.

    but to answer the initial question: yes more cores probably will help to do the workload more parallel instead of queuing and therefore get things done more easily. upgrading to 2 or even better 4 core most likely will make quite difference. for a while.

    still better to read and follow @jvnadr advice.

    I heard scaleway has 4 cores for 7.99 ... though, they don't support stupid paypal :-P

  • jure12jure12 Member
    edited December 2018

    @jvnadr said:
    At first, you don't know how to use a vps. I assume you host a live site there. DON'T.
    Pay more and use a managed service. You can't handle even the basics, how do you expect to react when your server will be hacked, have a malicious code, your MySQL corrupts, your server collapse or start sending tons of spam or DDoS attacks?
    Have you hardened your server? Did you disable root ssh access, did you setup keys, did you configure any firewall there?
    A VPS is not just setting up something vesta on it and wait to work.

    On topic now, your vps is probably weak to receive certain amount of traffic over a limit. I assume you have a CMS on it, probably Wordpress or something similar, with plugins. So, when you gain more visitors, they open a lot more of http pages and php-fpm instances than when the load is low.

    • Have you monitored the traffic to see how many live visitors are there when the CPU goes high? Have you investigate what script/page(s) is causing the php-fpm instances?
    • I guess you have not optimized anything there. Do you cache static files and your CMS? Or every time a visitor opens your first page, this page is being created from the beginning?
    • Do you minimize and cache js/css? Do you use any CDN with caching options to reduce load from the server? Have you optimized MySQL? What kind of tables do you use? INNO?
    • What optimization have you done in your PHP? How many worker connections do you allow?
    • Have you installed any proxy server like nginx to use it for static/cached files? Or you are using plain apache?
    • Have you checked your HDD? Is there any iowait? If yes, this will also cause load and delay.

    Bottomline:
    There are lot of things you can do to optimize your server. Can you understand what I wrote before? If not, move your site to a managed vps of, if this is too expensive for you, move it to a good shared hosting provider. You will have much more optimized performance, due to the optimized server, the usage of litespeed server, the caching etc. But again, you will have there also to optimize your site.

    Thank you for your answer first of all.
    Every point you have written up above I know exactly what you are talking about.

    My VPS server is optimized, I personally optimized it (apache, php, mysql, CDN).
    As I have already written, the problem is that the vps is sometimes "small" becouse of lots of visits that I get at a certain time.

  • Sirius business needs to run on sirius hardware.

  • My hardware is 'OVH VPS'.

  • VPS is software.

  • Yes, Software located at Hardware ;)

    Thanked by 1eol
  • smilesmile Member
    edited December 2018

    even though you are using less than half of your total memory; how is it possible you have 0 swap usage at 60 days with an active site? is mysql just for show?

  • FalzoFalzo Member
    edited December 2018

    Thanked by 2eol jvnadr
  • ShazanShazan Member, Host Rep

    If it is "optimized", then your last resource is to add a CPU core.

  • @smile said:
    even though you are using less than half of your total memory; how is it possible you have 0 swap usage at 60 days with an active site? is mysql just for show?

    I have to go to better vps and that's all.

  • jvnadrjvnadr Member
    edited December 2018

    jure12 said: Every point you have written up above I know exactly what you are talking about.

    You have not answered even to one question: What kind of website do you use, what if any CDN, if caching and at what level etc. If you don't really want help, then, why the hell did you open this thread?

    OK, I will give a last try:

    • You don't really know what optimization is. You probably THINK you know, but that's not true. You should at first used something behind like varnish or/and nginx to cache static files, or you would use only nginx with just a virtual core...
    • You have not optimized your apache. If you had, then, this 100% cpu time on 4 instances od "php-fpm pool php-admin" should not be there. It's not the number of the visitors, just 4 instances of php eats all your cpu.
    • There is not even a byte of cache of Mysql in a swap file. Even if the memory is not full, you should use something like 5-10% of swap there.
    • You haven't yet told us what kind of website you are using and what kind of caching and optimization you use there. Do you minify js/css/html? If yes, on what stage? Do you use cache on browsers and with what TTL? Do you use any CDN like Cloudflare? At last, how many visitors do you have when your load goes to 2.x and above?

    It's not bad to have a lack of knowledge. It is bad when you are trying to tell in a technical forum that you have that knowledge, especially when it is a clear thing that you don't. Even more, when you are asking in your original post questions that is not even primary in hosting skills (e.g. if I add a core will the load fall).
    And the worse thing would be if you really believe that you have knowledge and not admitting to yourself you don't!

    jure12 said: I have to go to better vps and that's all.

    This is the icing on the cake! You don't try to troubleshot your server but to hide the dust under the carpet. You may add a core or two, but soon enough, you will face same issues and your php will eat much more resources if you don't optimize your site and your server.
    At the end, you can buy a dedicated beast with 24 cores and 64GB memory for a single website with some hundered of daily visitors, but this is equal of buying a skyscraper just to use its basement to park your Hyundai Atos 1100cc car in the area...

    Thanked by 1eol
  • I wonder what this guy is on about. He refuses to send his own personal data, wants to use an anonymous vps, rejects anything that isn't PayPal and has a multi-tb website with such limited skills.

    Are you hosting rojadirecta?

  • I do not know how to close this thread, I checked all the logs and concluded that I needed better VPS.

    @jvnadr you do not know me, my knowledge own, so you can not write this:
    "You don't really know what optimization is."

    ... and the same thing I can not tell you, it just would not be okay.

    Related to VPS, I have a strong visit and VPS has only 1 vCore. I repeat my VPS is optimized: php, apache, mysql. I use Cloudflare (CDN) which I also maximally optimized.

    There is not much more here, 1 core is a little for the visit which my VPS receives.

    For Smart is enough ! ;)

Sign In or Register to comment.