-2

When I launch HTOP the CPU jumps from 3% to 40% during 1 seconds.

When I did some actions on my website, the CPU went to 100% in htop but everything was still as smooth as usual.

I also ran a program that used 100% CPU non-stop and around 1GB ram at the same time as my website and going through my website (php, mysql, html) wasn't slower than usual.

However the HTOP bars changed when doing some actions like becoming green instead of red.

Is it a problem to have a CPU constantly at 100% usage? Why doesn't it affect speed on my website (or in SSH)? Am I missing something?

  • We need more info in order to give you some answers. Can you tell how is your webserver configured? What type of CPU do you have? How many sockets, cores, threads... – sebastienvg Sep 12 '16 at 19:18
  • No idea for all of these. It's a simple core though, like 1.8ghz or 2.4ghz (no dual core). 2GB ram. My webserver is default I'd say. – pedrotester Sep 12 '16 at 20:22

1 Answers1

3

Many common computer server applications become more efficient the more work they have to do. There are a variety of reasons why this is so, but they generally come down to being able to do more work without interruption.

Imagine if you're tutoring every day and you only tutor two people. Each time you visit, you can only catch them up on what they missed since the last session. So you'll be spending a lot of time traveling from one person's location to the other's. You might get to a person's house to tutor them only to find that they have no new material to go over since the last time you were there.

Now imagine you're tutoring 20 people. By the time you get back to a person again, you've been gone for awhile. There will be lots of work to do with that person. You'll be spending more time tutoring and less time traveling, setting up to tutor, waiting for the person to be ready, and so on. You'll almost never get set up to tutor without getting a lot of useful tutoring work done.

So when your server hits 100% utilization, it may still be doing only a modest fraction of the work it's actually capable of getting done, spending a lot of time doing small bits of work, switching tasks, and populating cold caches. It can remain responsive and still have plenty of real capacity left.

David Schwartz
  • 31,449
  • 2
  • 55
  • 84