Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Optimize WordPress Performance on an Ubuntu Server

A measurement-first guide to speeding up WordPress on Ubuntu: identify the real bottleneck, configure caching and OPcache correctly, tune PHP-FPM and the database carefully, and validate every change.
Length11 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The fastest WordPress installation on Ubuntu is not defined by Apache, NGINX, a larger VPS, or a copied configuration file. It is the installation whose measured bottleneck is removed without creating a new one. Establish a baseline, determine whether the delay is in the network, web server, PHP, database, disk, or WordPress code, then change one layer and measure the same requests again. Full-page caching and OPcache often deliver the largest gains for anonymous traffic, while logged-in and personalized requests still depend on PHP, the database, and the application.

Start with evidence, not settings

Ubuntu’s performance guidance is explicit: “To tune you need to know your system and workload.” A server with idle CPU can still be slow because requests are waiting for PHP-FPM workers, disk I/O, a database lock, an external API, or a cache miss. Conversely, increasing worker counts or database memory can make a memory-constrained VPS slower by forcing swap activity.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

There is no authoritative universal percentage improvement for “WordPress on Ubuntu.” The result depends on the theme, plugins, traffic mix, PHP version, storage, geographic distance, cacheability, and current configuration.

Define a repeatable test set

Record the same representative requests before and after every change:

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
  • An anonymous page with an empty browser cache.
  • The same page after it should be cached.
  • A logged-in or otherwise personalized page.
  • A page that performs a search, form submission, checkout, or another dynamic operation, if your site has one.
  • A static asset such as a CSS file, JavaScript file, image, or font.

Run tests from the same location and at similar times. Record at least time to first byte (TTFB), total response time, HTTP status, response size, and error rate. A simple header-and-timing check is:

curl -o /dev/null -sS -D - -w '
connect=%{time_connect}s ttfb=%{time_starttransfer}s total=%{time_total}s status=%{http_code}
' https://example.com/

Run it several times for each URL. The first request can be a cache miss, while later requests may be served by a page cache. Keep those cases separate instead of averaging them together.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Observe each server layer

Layer What to measure What a symptom suggests
CPU Utilization, load, run queue, and per-process usage CPU saturation, inefficient PHP, expensive queries, or compression work
Memory Available memory, reclaimable cache, swap use, and pressure Worker over-allocation, database pressure, or swapping
Storage Read/write latency, queue depth, throughput, and free space Slow database or filesystem operations
Web server Connection counts, response status, access-log duration, and upstream errors Connection limits, slow clients, or proxy and FastCGI problems
PHP-FPM Active and idle workers, queue or listen backlog, request duration, and slow requests Worker saturation or expensive WordPress code
Database Query latency, slow queries, locks, connections, buffer-pool pressure, and disk latency Missing indexes, contention, or insufficient memory
Cache Page-cache hits and misses, object-cache behavior, and purge events Incorrect bypass rules, stale content, or an ineffective cache

Ubuntu tools such as vmstat, iostat, pidstat, ss, service logs, and your web-server access logs can provide this evidence. Install and enable monitoring deliberately; do not treat a single snapshot from top as a diagnosis. Set a target metric first—for example, lower uncached TTFB for anonymous pages or fewer PHP-FPM queue events—so a change can be judged objectively.

Keep the platform supported and recoverable

Before performance work, make a tested backup of the database, uploads, WordPress files, web-server configuration, PHP configuration, and service-unit settings. Keep a rollback copy of every file you edit. Test restoration on a separate location when possible.

Keep Ubuntu, the web server, PHP, MySQL or MariaDB, WordPress core, themes, and plugins current. Apply updates in a maintenance window, check compatibility, and re-run the baseline after each significant upgrade. The conventional Ubuntu WordPress stack uses Apache2, PHP, and MySQL; obtain WordPress from WordPress.org rather than relying on an old distribution archive package. Current software usually contains security and performance fixes, but an update is not automatically an optimization: measure it.

Choose Apache or NGINX from the workload

Both Apache and NGINX can serve WordPress successfully. Switching servers without identifying the bottleneck is not an optimization plan.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
Decision factor Apache NGINX
Static files Can serve them efficiently with familiar directory and module controls. Designed for efficient static-file and connection handling.
Configuration familiarity Often simplest for teams already using Apache modules and per-directory rules. Uses centralized server and location blocks; existing NGINX expertise matters.
PHP integration Commonly uses PHP-FPM through a proxy or an equivalent supported integration. Uses PHP-FPM through FastCGI and exposes clear upstream controls.
Page caching Can sit behind or work with a reverse proxy and supported cache modules. Provides a documented FastCGI-cache path and can act as the reverse proxy.
Operations Choose it when required modules, rewrite rules, and team knowledge reduce risk. Choose it when its proxy, static-file, and FastCGI model fits the traffic and team.
Best deciding evidence Your measured anonymous-versus-dynamic request mix, cache strategy, error logs, and maintenance capability—not a universal speed ranking.

For a site that serves mostly cacheable anonymous pages, either server can be fast when the cache is correct. For a highly dynamic site, PHP-FPM, database work, and application code are more likely to dominate than the choice between web servers.

Build caching in separate, understandable layers

Browser caching for static assets

Set appropriate Cache-Control and expiration behavior for versioned images, CSS, JavaScript, and fonts. Long-lived caching is safest when filenames change whenever content changes; otherwise a browser can retain an old asset. Do not apply an aggressive immutable policy to HTML that must reflect publishing or account state.

Full-page or reverse-proxy caching

A full-page cache stores rendered HTML for an anonymous, cacheable request. A reverse proxy can answer directly without invoking PHP or MySQL. Filesystem page caching is a slower fallback, but it still avoids repeating the complete WordPress computation.

Cache only responses that are safe to share. A typical NGINX FastCGI design defines a cache zone and bypasses requests that are not public. The exact directives must match your server layout, PHP-FPM socket, and site paths, so validate the configuration before reloading:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
fastcgi_cache_path /var/cache/nginx/wordpress levels=1:2 keys_zone=wordpress:100m inactive=60m use_temp_path=off;

In the relevant server and location blocks, create explicit conditions for:

  • Methods: bypass and do not store POST requests.
  • Query strings: bypass requests with query strings unless you have deliberately decided which parameters are cache-safe.
  • Private paths: exclude /wp-admin/, the login endpoint, cron endpoints, feeds, and sitemaps where caching would be incorrect for your configuration.
  • Cookies: bypass logged-in and commenter cookies, and any cookie that changes the response.
  • Responses: avoid storing errors, redirects that contain private state, and responses with private or no-cache directives.

Use response headers and cache-status logging to verify that the first request is a miss and the next eligible request is a hit. Add a purge mechanism tied to publishing, editing, deleting, and changing navigation or widgets. Without invalidation, a fast cache can serve stale pages.

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

Object and database caching

A persistent object cache can reduce repeated database work, but it is not a substitute for a page cache and should be introduced only when profiling shows repeated queries or a clear object-cache benefit. Document expiration and invalidation behavior. A stale object can produce incorrect application behavior even when the page cache is functioning correctly.

Do not stack overlapping cache systems blindly

Multiple plugins or server layers that each rewrite assets, minify files, generate pages, or set cache headers can conflict. Keep one owner for each responsibility where possible. After enabling or removing a layer, inspect the actual headers, HTML, generated files, and purge behavior rather than assuming the settings agree.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Enable and size PHP OPcache based on observations

OPcache is a PHP extension bundled with PHP 5.5 and later. It stores precompiled PHP bytecode in shared memory, so PHP does not parse and compile every WordPress file for every request.

Confirm that the FPM SAPI—not only the command-line PHP binary—has OPcache enabled. Inspect the loaded configuration and status through a controlled administrative method, then review:

  • opcache.memory_consumption, which limits shared bytecode memory.
  • opcache.interned_strings_buffer, which reserves memory for interned strings.
  • opcache.max_accelerated_files, which limits the number of cached script entries.
  • Hit rate, wasted memory, restart or invalidation events, and whether the cache is full.

Do not copy a generic php.ini snippet. A large plugin set may need different capacity from a small site, while excessive allocation can starve MySQL or PHP-FPM. After deploying changed PHP code, invalidate OPcache so workers cannot continue using old bytecode. Identify the installed FPM unit first:

systemctl list-units --type=service 'php*-fpm.service'

Then restart the specific installed unit during a controlled window, and verify that the site, OPcache status, and logs are healthy. A restart clears worker state, so plan it rather than doing it repeatedly as a substitute for fixing deployment invalidation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

Tune PHP-FPM without creating a memory crisis

PHP-FPM controls how many WordPress requests can execute concurrently. The important measurements are active and idle workers, listen-queue or backlog events, request duration, worker memory use, and slow-request traces.

Set worker limits from available memory

pm.max_children is a concurrency limit, not a speed setting. If each worker consumes substantial memory, raising it until the VPS swaps can increase every request’s latency. Estimate worker usage from production observations, reserve memory for the operating system and database, then change the pool gradually.

Coordinate timeouts

Align PHP-FPM request limits with the web server and proxy. A lower web-server timeout can terminate a request before PHP-FPM’s timeout, while a very high limit can leave workers occupied by stuck requests. Review slow logs and application behavior before changing timeout values. A timeout increase may hide an external API or plugin problem rather than improve performance.

Check the queue before adding workers

If the queue is empty and CPU or database latency is high, more workers will not help. If workers are continuously busy and memory is available, a controlled increase may reduce waiting. Re-measure both latency and memory pressure after the change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Reduce WordPress application work

Audit themes and plugins

A fast, lightweight theme generally performs more efficiently than a heavy, graphic-laden theme. Deactivate and delete plugins that are no longer needed. For active plugins, identify expensive hooks, scheduled jobs, queries, and remote calls. Do not assume a plugin is cheap because its visible feature is small; profile the requests it changes.

Avoid overlapping page-cache, minification, image-rewrite, and asset-optimization plugins. Test one implementation at a time and keep a documented rollback.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Separate public and private request paths

Anonymous article pages can often be served from a full-page cache. Logged-in dashboards, account pages, carts, checkout, search results, previews, and personalized content normally require PHP and may require database access on every request. Measure these paths separately and do not “fix” them by accidentally caching private responses.

Optimize images and static assets

Resize images to their display dimensions, use an efficient web format where your browser support and workflow allow it, and avoid shipping unnecessarily large originals. Compress CSS and JavaScript only when the resulting files remain debuggable and the transformation does not duplicate another layer. Set browser caching for stable assets and confirm that cache-busting changes the URL when an asset changes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Treat the database as a measured dependency

WordPress recommends InnoDB and describes database tuning as specialized and workload-dependent. Begin with slow-query logs, query duration, lock waits, table sizes, index use, connection counts, buffer-pool pressure, and storage latency.

  • Back up before schema or index changes.
  • Use query plans to confirm that a proposed index is useful.
  • Check whether a plugin creates large transient, logging, or session tables.
  • Watch disk space and file-descriptor limits as tables and connections grow.
  • Test changes against representative traffic, not only a single administrator request.

Do not paste an arbitrary my.cnf from another VPS. Buffer-pool size, connection limits, temporary-table settings, and log configuration must fit available memory, storage, and the actual workload. A database change that lowers one query’s time can worsen overall performance if it causes swapping or exceeds operating-system limits.

Be cautious with kernel and server-wide tuning

Kernel parameters, file-descriptor limits, TCP settings, worker counts, and compression levels affect more than WordPress. Ubuntu notes that a tunable can help one workload and hurt another. Change one setting, record the old value, define the metric it should improve, and keep a tested rollback.

Do not treat a high load average as proof of CPU shortage: uninterruptible I/O waits can raise load while processors remain idle. Likewise, low CPU use does not prove that the site has capacity if PHP-FPM workers are blocked or requests are waiting on the database.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Validate every change and operate the result

  1. Save the baseline timings, status codes, headers, resource observations, and cache state.
  2. Change one layer—for example, OPcache capacity, a single cache rule, one plugin, or one database index.
  3. Validate configuration syntax before reloading a service.
  4. Repeat the same uncached, cached, logged-in, dynamic, and static requests.
  5. Compare TTFB, total time, hit or miss behavior, CPU, memory, disk latency, PHP-FPM health, database latency, and errors.
  6. Publish or edit a test page and confirm that the correct cached pages are purged.
  7. Confirm that logged-in users, commenters, POST requests, feeds, administration, and other private paths bypass the public cache.
  8. Keep the change only if the target metric improves without unacceptable regressions; otherwise restore the previous configuration.

Use symptoms to choose the next investigation

Observed symptom Next checks
Cached pages are fast but uncached TTFB is high PHP-FPM worker time, slow WordPress hooks, database queries, external calls, and OPcache capacity
CPU is low but requests queue PHP-FPM listen queue, database locks, disk latency, network calls, and connection limits
Only the first request is slow Cache misses, OPcache warm-up, DNS or TLS setup, and cold database or filesystem state
Pages remain old after publishing Page-cache purge hooks, reverse-proxy invalidation, browser headers, and object-cache consistency
Logged-in users see public content Cookie-based bypass rules and whether a private response was stored in the page cache
Performance worsened after increasing workers Memory pressure, swap activity, database contention, and storage latency
Static assets are slow while PHP is healthy Asset size, storage latency, browser-cache headers, compression, and network location

Self-managed Ubuntu or managed WordPress hosting?

Self-management provides control over Ubuntu, the web server, PHP-FPM, the database, caching, monitoring, and migrations, but you own patching, backups, incident response, capacity planning, and rollback. Managed WordPress hosting can suit an owner who cannot perform those server tasks. Compare options on administrative skill and time, update and backup responsibility, cache implementation, monitoring, support scope, migration controls, geographic performance, and total cost. Whichever model you choose, require access to meaningful cache, PHP, database, and error metrics; a managed label does not replace measurement.

A practical order of operations

  1. Back up the site and capture a baseline for representative request types.
  2. Fix obvious application costs: outdated software, unnecessary plugins, oversized images, and avoidable external calls.
  3. Confirm OPcache is enabled for PHP-FPM and sized from its observed status.
  4. Implement one page-cache layer with explicit private-request bypasses and reliable purge behavior.
  5. Measure PHP-FPM and database behavior on requests that cannot be cached.
  6. Only then consider database, kernel, or server-wide tuning, changing one variable at a time.
  7. Document the final configuration, monitoring thresholds, rollback steps, and the date of the next review.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.