What is the most effective configuration for a server to run a news website?

Started by jina, Jun 17, 2022, 04:13 AM

Previous topic - Next topic

jinaTopic starter

This is my first time managing a news site, and I've been wondering how to optimize its performance. Initially, the web core vitals were good but in April they suddenly deteriorated.
What's strange is that the server resources are not being fully utilized; the CPU loads are at an average of 0.50 and there's plenty of free RAM and hard disk space even during traffic spikes. Therefore, I don't believe the issue is related to server resources.

The website is built on Wordpress with over 20,000 articles and has W3 Total Cache installed. The server-side includes FastCGI Nginx. With this configuration, the core vitals were fine until April, but now they're poor, and I can't seem to figure out why. My assumption is that news sites with a significant number of articles require specialized configurations or software, but I don't know where to start.

Can you offer any suggestions on how to restore the Core Vitals metrics? Thank you all.
  •  

Sevad

There are various methods for optimization, including optimizing the number of concurrent connections in nginx, adjusting the output buffer size in PHP-FPM,
enabling Gzip compression, monitoring and adjusting FastCGI settings correctly, using a content delivery network for static content such as images and JS libraries, selecting a host closer to your primary audience to reduce latency, monitoring and optimizing TTFB, and many more methods that may not be at the top of my mind currently.

Plan

The problem might be associated with the website design. You should check the site on GTMetrix and analyze the waterfall tab.
If you plan to gain proficiency in server administration through troubleshooting, it could end up being catastrophic when dealing with unmanaged servers. On managed servers, the provider is responsible for managing the server.

Consider obtaining another server or VPS and duplicating the site there to conduct your evaluations. I would suggest that web development and system administration are not synonymous. While having expertise in both fields can be beneficial, being an expert in one area is more advantageous.
  •  

JessicaJohn

Typically, companies are unwilling to modify their database configuration because data loss, even if it's a partial amount, can be a significant setback for them. As a consequence, even when the database utilizes just two-thirds of the web server's capacity, firms are hesitant to migrate to a more efficient setup that would be more expensive.

However, databases are susceptible to growth and increased demand, so here are some suggestions on how to increase the lifespan of a live server. One way to do this is by checking the slowest and most frequent queries using a tracking method that displays the top sluggish requests or slow log. For instance, optimizing queries that take longer than a second could enhance performance. Additionally, it would be beneficial to assess the most common requests and optimize them for optimal efficiency. After performing these tasks, there would be no need to choose a more powerful server to transfer the database.

Another strategy is to share the database load if feasible. The most overloaded database usually requires separate services for recording and reading data from a replica. One example is ClickHouse, which is utilized for analytics purposes. In this way, some of the data load is removed from the database, allowing the firm to continue using a modest cloud server. This means that they can avoid using dedicated servers for loaded databases and instead use an inexpensive virtual server.

For large, heavily-loaded databases, it might be worthwhile to consider hiring a Database Administrator (DBA). A DBA is a DevOps specialist who works with databases and can identify database architecture problems and optimize it for better performance. This practice can save a lot of money and benefit monthly salaries in excess while ensuring that the database performs optimally, resulting in faster application functionality for end-users.

Infrastructure optimization is often neglected due to a lack of time. However, delaying optimization can lead to accumulated technical debt, resulting in spending more time to pay it off or engaging third-party experts to fix the architecture or application code. To counteract this, it's advisable to optimize infrastructure while migrating web services from one provider to another. By doing so, monitoring can reveal if a less significant server is required for a web server, and thus, a more cost-effective server can be chosen.

In the long run, "Infrastructure as Code" would save a company's resources repeatedly. It is crucial to understand tools like Ansible and Terraform, as they enable the deployment of systems and configuration changes using Git saved configurations for the described infrastructure, both on new servers and in new locations.
  •  

intisiona

 I can offer some general suggestions that might help you improve the Core Web Vitals metrics for your news site.

1. Evaluate Plugin and Theme Performance: Review the plugins and themes you have installed on your WordPress site. Some poorly coded or outdated plugins/themes can impact performance. Consider disabling unnecessary plugins and switch to lightweight themes optimized for speed.

2. Optimize Caching: While you have W3 Total Cache installed, ensure it is properly configured to cache static resources like HTML, CSS, and JavaScript files. This can help reduce server load and improve page load times.

3. Content Delivery Network (CDN): Implementing a CDN can help distribute your website's content across servers globally, reducing latency and improving user experience. Look into popular CDN providers that integrate well with WordPress.

4. Minify and Compress Files: Enable file compression and minification of CSS and JavaScript files. This reduces their size and improves loading times.

5. Database Optimization: Optimize your WordPress database by removing unnecessary data, spam comments, post revisions, and unused tables. This can help improve overall website performance.

6. Image Optimization: Ensure images are compressed and properly sized before uploading them to your site. Large image sizes can significantly impact page load times.

7. Monitor Third-Party Scripts: Analyze the impact of third-party scripts, such as analytics or advertising scripts, on your website's performance. Consider removing or replacing them if they are causing delays.

8. Regularly Update WordPress and Plugins: Keeping your WordPress core, themes, and plugins up to date ensures you benefit from bug fixes, security patches, and performance improvements.

9. Run Performance Audits: Utilize tools like Google PageSpeed Insights, GTmetrix, or Pingdom to run performance audits. These tools can provide specific recommendations tailored to your website and pinpoint areas for improvement.

10. Consider Professional Assistance: If these suggestions don't lead to the desired improvements, you might want to consider consulting with a professional web developer or performance specialist who can analyze your website and provide more tailored recommendations.
  •