Server Overload

Hi,
We have a problem with our CS-Cart installation (4.4.3).
When we want to clear the cache (by ?cc or by deleting cache directory), it makes our server overload during cache reconstruction.
Our server has 4 cpu and 8Go ram.
It runs under SmartOS.
Hope you can give me some advice to find a solution or some way to look into.

The cache is built on demand.... Hence, the first page takes the most resource.

with your server config as described, you should not be encountering any problem with cache clear/rebuild.

Can you be more specific when you say "server overload"? What cache method are you using? Assuming you are using 'file' given you remove the cache directory.

Yes we are using the cache using "file"

Just after deleting the cache directory,CS-Cart start at once to rebuild the cache. It's pretty slow as when it's finished, the cache directory is around 15Mb. During the rebuild the charge goes up until 20 to 30, the cpu is overloaded but the memory stay OK.

I'm not understanding the terms you're using (like "charge goes up").

Can you speak to CPU usage (system and user) as well as file IO activity while the first page load is occurring?

What are other aspects of your site? Specifically, how many languages are active? How many categories? How many product features? These are all things that can multiply the times.

What is the TTFB of your homepage after clearing the cache versus once the cache is rebuilt?

The var/cache directory (and sub-folders) is 69M on my dev server which uses only the standard demo products and very few additons and has two languages (and lots of addons). So seems that 15M is rather small. But this has some runtime on it and the cache will continue to increase as new pages are accessed.