Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk10 min

How to Fix High MySQL Memory Usage on a VPS

High mysqld RSS is not automatically a leak. Measure host pressure first, attribute memory with MySQL and OS tools, then tune the buffer pool, connections, session buffers and temporary tables in controlled steps.

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.

High mysqld RAM usage is not automatically a leak. MySQL deliberately keeps data in the InnoDB buffer pool, reserves global caches, allocates buffers for each active connection and statement, and may retain Performance Schema memory until shutdown. The safe fix is to measure the VPS as a whole, identify which category is growing, then change one limit at a time.

Start by comparing MySQL’s resident memory with total and available host memory, swap activity, OOM-killer events, and the memory used by your web server, application runtime, cache, backups, and monitoring agents. Only then decide whether to reduce innodb_buffer_pool_size, cap connection or temporary-table memory, adjust instrumentation, or add capacity.

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.

What “high MySQL memory usage” actually means

There are three different measurements that are often confused:

  • Resident set size (RSS): pages of the mysqld process currently resident in physical RAM. This is what competes directly with other VPS processes.
  • Configured capacity: memory MySQL could use, such as the configured InnoDB buffer pool, max_connections, and per-session buffer limits. A high theoretical maximum may never be reached.
  • Host pressure: whether the VPS is short of reclaimable memory, actively swapping, or killing processes. A large RSS can be harmless when the host has ample available memory; a smaller process can be dangerous on a crowded VPS.

Linux may also report memory that is shared, mapped, cached by the allocator, or reserved for later use. Therefore, adding every MySQL variable does not produce an exact RSS prediction. Use the totals to find the dominant contributors and confirm the result under representative traffic.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

First response: check whether the VPS is under pressure

Run these checks before editing MySQL configuration. Save the output so you can compare it after each change.

  1. Record RAM and swap:
    free -h

    Note total, used, available, and swap figures. “Available” is more useful than “free” for judging whether the kernel can satisfy new allocations. Any sustained swap-in or swap-out indicates pressure even if mysqld itself appears stable.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  2. Measure the MySQL process:
    ps -o pid,ppid,rss,vsz,%mem,cmd -C mysqld

    RSS is shown in kilobytes by most ps implementations. If MySQL runs in a service manager or container, also inspect the service or cgroup memory limit and current usage; a cgroup can trigger an out-of-memory event before the physical VPS is completely full.

  3. Look for OOM kills:
    journalctl -k | grep -i -E 'out of memory|oom|killed process'

    On systems without a persistent journal, inspect the kernel log with the distribution’s normal log tool. An OOM event identifies an immediate capacity problem, but it does not by itself prove that MySQL was the process that caused the buildup.

  4. List competing consumers:

    Record memory used by Apache or another web server, PHP-FPM or other application workers, Redis, backup and compression jobs, monitoring agents, antivirus scanners, and replicas. A buffer pool that is acceptable on a database-only host may be unsafe when those services share the same VPS.

If available memory is healthy, swap is inactive, and there are no OOM events, do not reduce MySQL memory merely because a dashboard shows a large percentage. Continue to attribute the allocation first.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Where mysqld memory goes

InnoDB buffer pool

The buffer pool caches table and index pages, reducing disk reads. The Oracle MySQL Reference Manual states: “Typically, a recommended innodb_buffer_pool_size value is 50 to 75 percent of system memory.” That is a starting range for a typical database host, not a promise for a shared VPS. The operating system, web stack, connection spikes, temporary tables, backups, and other daemons all need memory outside the pool.

A pool that is too large can push the host into swapping. A pool that is too small can cause page churn and more disk I/O. The correct value is the largest setting that leaves reliable headroom during peak concurrency, not the largest percentage that fits at idle.

Global buffers and caches

Other process-wide consumers include innodb_log_buffer_size and, for installations using MyISAM, key_buffer_size. Their impact depends on the storage engines and workload. SHOW ENGINE INNODB STATUSG provides buffer-pool information that helps confirm whether the pool is actually the dominant consumer.

Per-connection and per-statement buffers

Every established session consumes connection memory. The connection and result buffers start at net_buffer_length and can grow as needed up to max_allowed_packet. Each session also receives max_digest_length bytes for statement digests. Sort, join, read, and read-random buffers can be allocated per operation or per session, depending on the operation and release.

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

This makes max_connections a capacity multiplier, not a performance target. A high limit may look harmless when only a few clients are connected, then create a sudden spike when a web pool, cron job, and reporting task connect at the same time.

Internal temporary tables

Queries that need an internal temporary table can consume RAM up to the applicable limits, including tmp_table_size and max_heap_table_size. Large sorts, grouping, or joins may therefore create short-lived peaks even when the baseline process size is unchanged. Lowering these limits can force oversized results to disk, protecting RAM at the cost of I/O and potentially higher latency. The durable fix is usually to improve the query or add an appropriate index after identifying the workload.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Performance Schema

Performance Schema may allocate memory at startup and while the server runs. It does not free that memory during normal operation; it releases it when the server shuts down. Autoscaled buffers can be capped with the relevant sizing parameters. A growing Performance Schema category is not automatically a leak, but unexplained, continuing growth after instrumentation is accounted for deserves investigation.

Capture the configuration and real concurrency

Run the following query to record the settings most relevant to memory:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
SHOW VARIABLES WHERE Variable_name IN (
  'innodb_buffer_pool_size',
  'innodb_log_buffer_size',
  'max_connections',
  'max_allowed_packet',
  'net_buffer_length',
  'sort_buffer_size',
  'join_buffer_size',
  'read_buffer_size',
  'read_rnd_buffer_size',
  'tmp_table_size',
  'max_heap_table_size',
  'performance_schema'
);

Then capture current and historical connection pressure:

SHOW GLOBAL STATUS WHERE Variable_name IN (
  'Threads_connected',
  'Threads_running',
  'Max_used_connections'
);
  • Threads_connected is the number of currently open sessions.
  • Threads_running is the number actively executing at the instant of the sample.
  • Max_used_connections records the highest simultaneous connection count since the server started or the status was reset.

Take several samples during a busy period. A configured max_connections far above observed peaks is a candidate for reduction, but first verify the connection-pool settings and whether short-lived jobs create bursts that your sample missed.

Attribute memory with Performance Schema

If Performance Schema is enabled, use it to identify the code area rather than guessing from RSS. Check the memory/% instruments in performance_schema.setup_instruments, enabling the appropriate instruments according to the manual for your MySQL release. Then query the memory summary tables, including:

SELECT EVENT_NAME, CURRENT_NUMBER_OF_BYTES_USED,
       HIGH_NUMBER_OF_BYTES_USED
FROM performance_schema.memory_summary_global_by_event_name
WHERE EVENT_NAME LIKE 'memory/%'
ORDER BY CURRENT_NUMBER_OF_BYTES_USED DESC;

Account and thread summary tables can show whether a particular user, connection, or workload is responsible. Instrumented totals will not exactly equal process RSS: allocator metadata, thread stacks, shared libraries, and uninstrumented areas account for the difference. Treat the result as attribution, not as an exact replacement for the operating-system measurement.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Do not disable Performance Schema blindly. If it identifies a category that grows with a particular workload, investigate that workload or cap the relevant autoscaled sizing parameter. A restart releases Performance Schema memory as containment, but a recurring pattern still requires finding the cause.

Inspect InnoDB before changing its size

Run:

SHOW ENGINE INNODB STATUSG

Review the buffer-pool section and compare it with the configured innodb_buffer_pool_size. If the pool consumes most of the VPS and application services are competing for RAM, reduce it in a controlled step rather than cutting it to an arbitrary fraction.

MySQL supports dynamic configuration for some settings, but exact behavior, resize mechanics, and minimums vary by installed release and distribution. Confirm the behavior for your version, schedule changes during a quiet period, and monitor the resize operation. If a setting requires a restart, edit the persistent configuration and plan the outage; do not assume a running-session change will survive a reboot.

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 the largest avoidable consumers

1. Resize the buffer pool with headroom

  1. Establish the VPS’s peak available memory while all non-MySQL services are active.
  2. Estimate the memory needed for connection bursts, temporary tables, the operating system, and filesystem cache.
  3. If the buffer pool is the dominant consumer, lower it by a modest, documented step.
  4. Recheck available memory, swap activity, query latency, buffer-pool hit behavior, and disk I/O during representative load.
  5. Keep the change only if the VPS gains safe headroom without unacceptable query degradation.

For example, on a small shared VPS, applying the 50–75% guidance to total RAM without reserving memory for PHP workers or backups can still cause swapping. The percentage is a reference point, not permission to allocate every remaining gigabyte to InnoDB.

2. Set a defensible connection ceiling

Compare Max_used_connections with max_connections and the application’s pool limits. If the ceiling is unjustifiably high, lower it in a staged change and ensure the application handles a refused connection gracefully. A lower limit protects the whole VPS from a connection storm, but an excessively low value can cause application errors. Fix connection leaks and right-size pools rather than using a large ceiling to hide them.

3. Keep session buffers proportional to the workload

Review max_allowed_packet, sort_buffer_size, join_buffer_size, read_buffer_size, and read_rnd_buffer_size. These values can multiply across concurrent sessions or operations. Set them for queries you actually run, not for a theoretical maximum. Raising all of them globally is a common way to turn a modest connection spike into an OOM event.

If only one reporting query needs a larger packet or sort area, prefer a targeted session setting or a query/index improvement when supported by your application. Test large imports and legitimate long rows before lowering max_allowed_packet; otherwise, clients may receive packet-size errors.

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

4. Limit in-memory temporary tables

If memory summaries, status counters, or query inspection point to internal temporary tables, lower tmp_table_size and max_heap_table_size together so oversized results spill to disk consistently. Monitor temporary-table disk activity and latency immediately afterward. Then identify the queries creating the tables and address avoidable sorting, grouping, or missing indexes. This change protects RAM but deliberately trades memory pressure for storage I/O.

5. Manage Performance Schema deliberately

Use the memory instruments to find the category first. Cap autoscaled buffers only when you understand what data or resolution you are giving up. Keep enough instrumentation to diagnose future incidents. Restarting the service can reclaim retained Performance Schema allocations, but schedule that as maintenance and treat it as containment rather than a permanent fix.

Compare the available remedies

Remedy Peak-memory effect Likely trade-off Restart requirement Protects
Reduce innodb_buffer_pool_size Large reduction when the pool dominates More disk reads and possible query latency Release-dependent; verify before changing Whole VPS, by leaving room outside MySQL
Lower max_connections Limits connection-storm peaks Connection failures if set below real bursts Release- and configuration-dependent Whole VPS
Lower per-session buffers Reduces multiplied session allocations Some sorts, joins, or large results may slow or fail Often configuration-dependent Whole VPS during concurrency spikes
Lower temporary-table limits Constrains in-memory query spikes More temporary files and I/O Configuration-dependent Whole VPS
Adjust Performance Schema sizing Controls instrumented growth Less retained diagnostic capacity Some limits take effect only at startup MySQL’s instrumentation footprint
Restart MySQL Releases memory retained until shutdown Downtime and recurrence if the cause remains Yes MySQL process temporarily
Increase VPS RAM or move to managed MySQL Adds capacity without shrinking caches Higher cost or migration/operational changes Provider- or migration-dependent Whole deployment

Choose based on the measured allocation mix. Resizing the VPS does not cure a runaway workload, while aggressive MySQL limits can merely shift the problem into disk I/O or application errors.

Validate every change and keep a rollback path

After each single change, observe at least one representative busy period. Record:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Available RAM and swap-in/swap-out activity from the operating system.
  • mysqld RSS and the VPS or cgroup memory limit.
  • OOM-killer or service-restart events.
  • Threads_connected, Threads_running, and Max_used_connections.
  • Query latency, error rates, connection failures, temporary-table disk activity, and application timeouts.
  • InnoDB buffer-pool behavior and disk I/O after any pool reduction.

Write down the old value before editing persistent configuration. If latency or errors worsen, restore that value, apply the required reload or restart, and investigate the workload before trying another change. Avoid changing several global limits at once; otherwise you cannot tell which trade-off caused the result.

When tuning is not enough

If measured settings are reasonable, the VPS still swaps or records OOM kills, and application services cannot be reduced, the host is undersized for the workload. Add RAM or move MySQL to a managed service with an appropriate memory tier. Persistent unexplained growth after Performance Schema and OS attribution warrants investigation for a workload or software defect; a restart may provide temporary relief, but recurring growth should not be accepted as normal operation.

A practical order of operations

  1. Measure total and available RAM, swap, mysqld RSS, cgroup limits, and OOM events.
  2. Record competing services and capture MySQL variables and connection-status counters.
  3. Attribute memory with Performance Schema and inspect SHOW ENGINE INNODB STATUSG.
  4. Reduce an oversized buffer pool only after reserving host and application headroom.
  5. Right-size max_connections and per-session buffers against observed concurrency.
  6. Constrain temporary-table memory when evidence points to internal temporary tables, then fix the generating queries.
  7. Review Performance Schema sizing without disabling useful instrumentation blindly.
  8. Validate under representative load; if safe settings still leave no margin, add capacity.

The goal is not the smallest possible mysqld process. It is a stable VPS with enough memory for MySQL, the operating system, and every service that must run beside it.

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.

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

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 from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

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.