If your hosting provider has notified you that your website’s CPU usage is high, it is possible that NitroPack is the cause.
➡️Here are two reasons why this may happen:
Excessive Cache Warmup
If your site has a lot of pages to warm up (pre-optimize) and/or lacks enough server resources, warming up the cache may cause a spike in CPU usage.
Our Cache Warmup feature imitates real user hits and visits many URLs in a short timeframe.
If the requests cause the CPU of the server to spike, you can try:
1. Limiting the number of URLs in your website’s sitemap to the top 10-20% of pages that receive the highest traffic.
First, check what your highest traffic pages are via a tracking service such as Google Analytics.
After doing so, the URLs can be used to create a custom sitemap that contains only those pages.
2. Remove your sitemap from the Cache Warmup and leave your homepage URL only.
To do this, head over to our Cache Warmup page: https://nitropack.io/cache-warmup
Inside the configuration there, simply remove the Sitemap URL and Save your changes.
3. Disabling the Cache Warmup completely and relying on real user visits to trigger optimizations.
This option is less ideal than the others, as your website’s pages are optimized only after a user visits them.
If you wish to do this, head over to the Cache Warmup page, then simply Toggle off the feature and hit Save.
4. Purge the cache in during periods of low activity. This can be at night or when you know less traffic is generated.
If all of your website’s pages have already been optimized and you need to re-optimize all of them, you can try doing a full purge of the cache only in periods of low activity on your website so that NitroPack can re-optimize the pages when there is less traffic, and our contribution to the CPU usage would be lower.
To do a full cache purge, head to the Cache Status tab and hit “Purge All Cache”.
A lot of URLs are queued for optimization
📍Optimizations are queued when their status is “Pending” in https://nitropack.io/user/pages
Unless there is a lot of traffic to the website, many pages being queued for optimization are usually related to our Cache Warmup.
The process of optimizing the website involves our service fetching all of the resources from your server and optimizing them on our end.
The fetching process may overload the server by sending too many requests in a short period of time.
Also, when an optimization is ready for a given URL, we send another webhook to notify the server, which counts as another request.
If you are experiencing High CPU usage and believe that NitroPack is the reason for it, reach out to our support team at [email protected] or via this link: https://support.nitropack.io