On a packaged Ubuntu installation, the durable way to change MySQL’s connection ceiling is to edit /etc/mysql/mysql.conf.d/mysqld.cnf, set max_connections inside the [mysqld] section, and restart mysql.service. For an immediate change without a restart, an authorized MySQL account can run SET GLOBAL max_connections = 300;. Use a measured value: every additional possible session consumes memory and file descriptors, so raising the number blindly can make an overloaded server less stable.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
What max_connections controls
max_connections is a global, dynamic integer variable. It sets the maximum number of client connections that the MySQL server will accept at once. The setting can be supplied at startup in an option file or changed while the server is running with SQL.
As an Amazon Associate I earn from qualifying purchases.
A connection is a server-side session, not necessarily a query that is executing at this instant. An application connection pool may keep many idle sessions open, so a high connection count can exist even when CPU usage is low. Conversely, a smaller number of busy sessions can consume substantial memory and produce long response times. The useful target is therefore the highest measured concurrent demand your Ubuntu host can sustain, plus a deliberately chosen margin.
Choose a safe value before changing anything
Measure demand instead of copying another server
Start by observing the current ceiling, the number of connected sessions, the number actively running work, and whether MySQL has already rejected sessions because the limit was reached:
#1 Best Overall
- 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.
SHOW GLOBAL VARIABLES LIKE 'max_connections';
SHOW GLOBAL STATUS LIKE 'Threads_connected';
SHOW GLOBAL STATUS LIKE 'Threads_running';
SHOW GLOBAL STATUS LIKE 'Connection_errors_max_connections';
max_connectionsis the configured global ceiling.Threads_connectedis the current number of client sessions.Threads_runningshows sessions currently executing work rather than merely connected.Connection_errors_max_connectionsincreases when MySQL refuses a connection because the ceiling has been reached.
Record these values during the busiest periods of the workload, not only during a quiet maintenance window. A rising error counter together with a Threads_connected value repeatedly close to the ceiling is evidence of connection pressure. If the counter is rising while the application opens excessive idle sessions, fix pool sizing or connection lifetime as well as considering a higher limit.
Account for memory and file descriptors
MySQL states that the practical limit depends on available RAM, memory used per connection, workload, desired response time, and available file descriptors. Increasing the setting increases the number of file descriptors that mysqld may need. A value that fits one host can exhaust memory or descriptors on another host running the same Ubuntu release.
Recommended Free Tools
Before choosing a number, check the service’s descriptor allowance and compare it with the number of sockets and files the database already uses. On a systemd-managed Ubuntu service, inspect the unit’s limit with:
sudo systemctl show mysql.service -p LimitNOFILE
If the proposed connection count approaches the available descriptor budget, raise the service limit through your normal systemd configuration process before increasing MySQL’s ceiling. Treat the shell’s ulimit as a separate context: a limit shown in an interactive shell does not by itself prove what the systemd service receives.
Oracle’s MySQL documentation describes Linux or Solaris systems as able to support at least 500 to 1,000 simultaneous connections routinely, and up to 10,000 in high-memory, low-per-connection-demand conditions. Those are broad capability statements, not recommendations for a particular Ubuntu machine. Your measured workload and resource headroom remain the deciding factors.
Rank #2
- 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
Persistent Ubuntu configuration with mysqld.cnf
Ubuntu’s packaged MySQL layout commonly places the server options in /etc/mysql/mysql.conf.d/mysqld.cnf. Editing this file makes the value part of the host’s normal option-file configuration, so it is reapplied when MySQL starts.
- Create a dated backup before editing:
sudo cp -p /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/mysql.conf.d/mysqld.cnf.$(date +%F-%H%M%S).bak. - Open the file with a root-capable editor:
sudoedit /etc/mysql/mysql.conf.d/mysqld.cnf. - Find the existing
[mysqld]section. If it is absent, add that section once. Inside it, add or change the setting, for example:[mysqld] max_connections = 300 - Save the file. Keep the value as an integer and avoid placing it under a client section such as
[client]; those sections do not configure the server variable. - Restart the Debian-family MySQL service and check that it started cleanly:
sudo systemctl restart mysql.service sudo systemctl status mysql.service - Connect to MySQL and verify the effective value:
SHOW GLOBAL VARIABLES LIKE 'max_connections';
Use one authoritative option-file entry. Duplicate entries in several included files make later troubleshooting difficult because the effective value depends on option-file load order. If your installation uses a nonstandard layout, identify the file used by that package before editing rather than creating an unrelated configuration file.
A restart is an operational interruption: plan it for a maintenance window or another period when clients can reconnect. The status command should be checked immediately; if the unit is not active, do not repeatedly retry the restart while an invalid configuration remains in place. Restore the backup or remove the new line, then inspect the service journal using your normal Ubuntu incident procedure.
Change the limit immediately with SET GLOBAL
When the server is running and you need the new ceiling immediately, connect with an account authorized to change global variables and execute:
SET GLOBAL max_connections = 300;
SHOW GLOBAL VARIABLES LIKE 'max_connections';
The second statement confirms the value currently held by the running server. This route does not require a service restart, so it is useful during a connection surge or when a restart cannot be scheduled. The change is a live server setting; by itself, it is not a durable Ubuntu option-file change and should not be treated as configuration-management history.
Rank #3
- 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)
Because this statement affects the global server variable, use the same capacity checks as for a file edit. A successful statement proves that MySQL accepted the integer; it does not prove that the host has enough memory or file descriptors for a sustained peak at that level.
Persist a SQL change with SET PERSIST
MySQL also provides a persistence mechanism managed by the server itself:
SET PERSIST max_connections = 300;
SHOW GLOBAL VARIABLES LIKE 'max_connections';
SET PERSIST applies the value to the running server and writes the persisted setting to MySQL’s mysqld-auto.cnf, allowing it to be restored after a restart. It is useful when database administrators need a SQL-auditable change without manually editing the Ubuntu option file.
Choose a persistence owner deliberately. If you set a value in mysqld-auto.cnf and a different value in mysqld.cnf, operators can see conflicting sources and may not know which one to change during rollback. Decide whether your organization manages this variable through Ubuntu configuration files or through MySQL’s persisted settings, then keep the other location from silently overriding that decision.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Runtime SQL, SET PERSIST, and option-file editing compared
| Method | Restart needed | Survives restart | Where the setting is recorded | Best fit |
|---|---|---|---|---|
SET GLOBAL |
No | No, unless separately persisted | Running server state | Fast mitigation while investigating a live incident |
SET PERSIST |
No | Yes | MySQL’s mysqld-auto.cnf |
SQL-managed persistence with no service restart |
mysqld.cnf edit |
Yes | Yes | Ubuntu option-file configuration | Configuration-management workflows and familiar host administration |
All three methods change the same global variable, but they differ in interruption, rollback, and audit trail. If you use SET GLOBAL as an emergency measure, document the value and follow up with the selected persistent method; otherwise the next restart can restore the old ceiling.
Rank #4
- 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
Verify that the new limit actually helps
Confirm the effective value
Always query the running server after a change. For an option-file edit, a successful service restart plus the SHOW GLOBAL VARIABLES result confirms that MySQL loaded the intended value. For either SQL method, the same query confirms the live state immediately.
Watch connection pressure after the change
Repeat the status queries during the workload peak. A lower error rate with a stable response time indicates that the ceiling was part of the problem. If Threads_connected grows toward the new value, check whether an application pool is retaining idle sessions. If Threads_running remains high and response time deteriorates, more connections may be allowing more concurrent work than the server can execute efficiently; the limit alone does not solve query or resource contention.
Check for descriptor exhaustion
If clients still cannot connect after raising the variable, inspect service logs and the systemd LimitNOFILE value. MySQL can require more descriptors as the permitted session count rises. A descriptor shortage is a separate bottleneck from max_connections; increasing the SQL variable again will not remove it.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Emergency access when the server is saturated
MySQL reserves one additional client slot beyond the configured limit. In practice, the server permits max_connections + 1 client connections, with that extra slot reserved for an account holding the CONNECTION_ADMIN privilege (or the deprecated SUPER privilege). Keep an appropriate administrative account available so you can connect, inspect the status counters, and correct the underlying pressure even when ordinary clients have filled the configured slots.
Use the reserved slot for diagnosis and remediation, not as an application capacity target. It is a safety valve for administration, not an extra pool connection to allocate in normal operation.
Best Value
- 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.
Common failure modes and recovery paths
The value changes, then reverts after reboot
This occurs when only SET GLOBAL was used. Apply the chosen persistent method: place the value in the Ubuntu [mysqld] option-file section and restart during a maintenance window, or use SET PERSIST so MySQL records it in mysqld-auto.cnf. Do not leave contradictory values in both persistence locations.
The restart fails after editing the file
First inspect the edited file for a misspelled section, a non-integer value, or a setting accidentally placed outside [mysqld]. Restore the dated backup if necessary, then start the service and verify its status before attempting another change. Keep the previous working value until the syntax and service state are confirmed.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteMySQL refuses the SQL statement
The session must use an account authorized to change global variables. If the statement is rejected, have an administrator perform it or grant the narrowly scoped administrative capability required by your organization’s access policy. Do not work around an authorization error by editing files as an untracked emergency change.
Connections are still rejected at the new value
Run the four diagnostic queries again. If Connection_errors_max_connections continues to rise and Threads_connected is near the new ceiling, demand is still exceeding capacity or the application pool is oversized. If the counter does not explain the failures, investigate other causes such as network reachability, authentication, descriptor limits, or service health rather than raising max_connections repeatedly.
The host becomes slow after raising the limit
More permitted sessions can increase aggregate per-connection memory and concurrent work. Compare memory availability, Threads_running, and response time before and after the change. Reduce the value to the last known safe setting, correct connection-pool behavior, or address workload contention when the higher ceiling causes degradation. A lower limit that protects response time is preferable to a nominally higher limit that exhausts the host.
Rollback and change-management checklist
Rollback depends on where the value was persisted:
- For a runtime-only change, issue
SET GLOBAL max_connections = <previous-value>;and verify it. - For a
SET PERSISTchange, replace it with the approved value usingSET PERSISTor remove the persisted setting according to your MySQL administration procedure, then verify the effective variable. - For an option-file change, restore the prior line or backup, restart
mysql.service, and checksystemctl status mysql.serviceplus the SQL variable.
Record the old and new values, the measurement that justified the change, who approved it, and whether it was runtime-only or persistent. This prevents a temporary incident response from becoming an undocumented production configuration.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteA practical decision sequence
- Measure
max_connections,Threads_connected,Threads_running, andConnection_errors_max_connectionsduring peak demand. - Estimate memory and descriptor headroom on the specific Ubuntu host, including the systemd service limit.
- If users are blocked now, apply a conservative
SET GLOBALvalue that the host can support and monitor it. - Select one durable owner: Ubuntu’s
mysqld.cnfor MySQL’sSET PERSIST. - Validate the effective value, service health, connection errors, and application response time.
- If pressure returns, investigate pooling and workload concurrency instead of increasing the number indefinitely.
This process distinguishes a genuine connection-ceiling problem from an application or host-capacity problem, while preserving an administrative path into a saturated server.
Quick Recap
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.




