Jump to content
  • 0

Ubuntu Mysql Too Many Connections after launching gameserver


Question

Posted

Hi there,

 

My problem is: I can connect remotely to the database (using navicat) when the gameserver isn't running.

However after I launch the gameserver on my server machine and I try to connect remotely to the database I get the Too Many Connections error.

After I kill the gameserver I'm still unable to connect to the DB until i restart mysql.

 

And the same thing happens if I simply quit navicat while I'm logged in the DB without closing the connection first.

 

Does anyone have any ideas what may be the issue?

 

 

Recommended Posts

  • 0
Posted (edited)

Meanwhile I realised that I had the max DB connection set to 40 in the server,properties and I had to set a value bigger than 40 in the mysql's .cnf file.

 

And now it seems to be working.

 

Does that mean that the amount of connections I set in the server.properties is automatically reserved on server startup?

 

Also, I would like to ask you guys: What would be the optimal DB connection amount for  (lets say 400-500 players) in server.properties / and in the mysql config.

 

Thanks in advance.

Edited by Horse
  • 0
Posted

1.Another Linux Ubuntu wannabe user :P

2. Still using Navicat FFS! Have you heard about HeidiSQL?

3. At for MySQL just keep the default 50 db connections otherwise with 200, 400 or even more you'll have big problems :))

..there is a reason in that keeping the "default" values. 

4. GL & HF! ;)

  • 0
Posted
2 hours ago, Irelia#1 said:

2. Still using Navicat FFS! Have you heard about HeidiSQL?

 

Navicat is actually very proper.

 

 

  • 0
Posted

did you connect your website in your database? :D

if yes imagine a ddos attack in your site what damage can do in your game server, well something like that :)

  • 0
Posted (edited)
17 hours ago, Irelia#1 said:

1.Another Linux Ubuntu wannabe user :P

2. Still using Navicat FFS! Have you heard about HeidiSQL?

3. At for MySQL just keep the default 50 db connections otherwise with 200, 400 or even more you'll have big problems :))

..there is a reason in that keeping the "default" values. 

4. GL & HF! ;)

 My mistake, i meant to write 40 not 400. The default value was 100 which I actually lowered.

 

Although as far as i understand even that value is higher than it actually should be. Since it shouldn't be higher than core numbers * 2 + effective spindles.

 

And yet After browsing through many source files of other projects i see the following:  MaxDbConnections on L2j : 100, Mobius: 500, Tales:999 and so on all higher than 100 or even above 500. So, yea it left me perplexed.

And that is why I am asking if there's an optimal value, or I'm missing something and there's a reason these projects have very high dbconnection values.

 

As for HeidiSQL I used it before switching  to  Navicat Premium which seems far better in my humble opinion, but each to its own, i guess.

 

 

As for your sarcasm, I doubt any of us are given birth as Linux experts. I barely used linux before, so yea, obviously I ask to better understand it.

 

14 hours ago, Nightw0lf said:

did you connect your website in your database? :D

if yes imagine a ddos attack in your site what damage can do in your game server, well something like that :)

Naturally, I 'm not planning to expose my DB to that, so no.

 

 

 

Edited by Horse
  • 0
Posted

Let me get this, so you "touch" the values without having backup now asking for help?

each project has its own customs inside (for me the more connections they use the worse they are)

 

just for you to know the obvious reason is the server as a cause

and the solution is

1) make bigger the pool

2) reduse server's pool

 

if you dont get that until now do a fresh install in your OS and start over (it helps).

  • 0
Posted
26 minutes ago, Nightw0lf said:

Let me get this, so you "touch" the values without having backup now asking for help?

each project has its own customs inside (for me the more connections they use the worse they are)

 

just for you to know the obvious reason is the server as a cause

and the solution is

1) make bigger the pool

2) reduse server's pool

 

if you dont get that until now do a fresh install in your OS and start over (it helps).

 

It's a bit hard to understand what you are trying to say, but I take it you assume i'm talking about a live server while I'm not.

Therefore, talking about backup at this point seems irrelevant.

Regardless of defualt or non-default values, the problem is that I had to set the number of connections higher in the mysql settings compared to the servers settings in order to be able to connect to the DB remotely through navicat.

And I simply wish to properly understand why is that, and why many projects have such high maxdbconnection values while in theory it wouldn't be needed, that's all.

 

  • 0
Posted
1 hour ago, Nightw0lf said:

just go with l2off maybe java is not for you then

No offense, but it seems you don't even understand what I'm asking, so I'd appreciate if you didn't post random,totally irrelevant suggestions out of the blue, if you can't answer my quiestion.

  • 0
Posted
2 hours ago, Horse said:

Regardless of defualt or non-default values, the problem is that I had to set the number of connections higher in the mysql settings compared to the servers settings in order to be able to connect to the DB remotely through navicat. 

And I simply wish to properly understand why is that, and why many projects have such high maxdbconnection values while in theory it wouldn't be needed, that's all. 

you ask why projects need to many connections, if you cant handle that fact or work with it i gave you the solution, if you want to know why project creators did that or why ask them they are about 50-60 years old fellows now, hard to find them on the internet, but oh wait i answered that when i told you,

3 hours ago, Nightw0lf said:

each project has its own customs inside (for me the more connections they use the worse they are)

implying custom as custom code that uses database inserts/updates/deletes that count as a connection to database capish?

  • 0
Posted
3 minutes ago, Nightw0lf said:

you ask why projects need to many connections, if you cant handle that fact or work with it i gave you the solution, if you want to know why project creators did that or why ask them they are about 50-60 years old fellows now, hard to find them on the internet, but oh wait i answered that when i told you,

 

 50 -60 years old fellows? the hell are you talking about? Clearly not about l2j projects. I think you have some serious misunderstandings here.

 

8 minutes ago, Nightw0lf said:

 

implying custom as custom code that uses database inserts/updates/deletes that count as a connection to database capish?

Thanks for stating the obvious...then again... it has hardly anything to do with my question ..lol.

  • 0
Posted

ok i give up you cant even understand your problem at least check google, how mysql works, what keep alive connection is, how long it stays alive and specially if you KILL your server without proper close in order to close that connection pool.

  • 0
Posted (edited)
54 minutes ago, Nightw0lf said:

ok i give up you cant even understand your problem at least check google, how mysql works, what keep alive connection is, how long it stays alive and specially if you KILL your server without proper close in order to close that connection pool.

The first thing that actually made some sense. Yes, one time I hadn't properly shut down theserver, and the connections were not properly closed.

 

 

Ofc my main question still stands, why do I need more mysql connections than server side maxdbconnections value.

 

The reason I am asking this is because I have never encountered such a problem when I was using windows or windows server.

Edited by Horse

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Update M54: Global HP/MP/CP consumable handling expanded beyond combat-only usage. Offensive mage idle recovery with learned skill Battle Heal. Spellhowler/Storm Screamer prioritizes Hurricane, using Vampiric Claw mostly below 90% HP. Major structural refactor initialized: Added category/class organization such as Archer, Dagger, Tank, Mage, Healer, Support and Specialized class files. Further structural cleanup. Extracted combat memory/state and more class-policy logic from the main controller. Added global stuck/inactivity watchdog for bots blocked by terrain/geodata. Added unreachable dropped ground-item timeout/temporary blacklist. Reworked Necromancer/Soultaker PvP: Dominator level 78+ maintains learned Arcane Power toggle on. Overlord/Dominator level 44+ maintains learned Soul Guard toggle automatically. Stability/scalability update: Bot controller ticks staggered instead of all starting in the same phase: Same 350 ms update rate retained Reduces simultaneous AI workload bursts. Removed the old manual aggressive-monster EVT_AGGRESSION bridge. Phantoms now use native Lucera setActive() behavior so monsters aggro them naturally. Reduced unnecessary NPC scans and native AI event pressure. Added saved-bot equipment overrides using a separate database table:         lucera_autobots_items Existing lucera_autobots remains the main saved-bot identity/state table. Equipment rows are linked to saved bots through bot_id. Added optional convenience view to show bot name together with equipment overrides:         lucera_autobots_items_view Added editable equipment slots in columns: Weapon Shield Helmet Chest Legs Gloves Boots Necklace Left/Right Earrings Left/Right Rings Equipment override values: 0 = use normal class/level profile item -1 = force slot empty >0 = equip that Item ID Custom equipment works only for saved database bots. Default class/level equipment profiles remain unchanged. Supports custom equipment from No Grade to S Grade, regardless of the bot's current level. Added validation for invalid item IDs and incompatible equipment slots. Added handling for: Two-handed weapons vs shields Full-body armor vs separate leggings Added all-grade Soulshots and Spiritshots to bot inventory/replenishment so custom lower-grade weapons still use the correct shots. Mage profiles that already use Blessed Spiritshots keep that behavior with all relevant grades available. First save the bot normally so it exists in table:         lucera_autobots Then open:         lucera_autobots_items Find the row with the same bot_id and edit only the equipment slots you want. Example: weapon_id = 6608 shield_id = -1 helmet_id = 0 chest_id = 0 legs_id = 0 gloves_id = 0 boots_id = 0 This means: weapon_id 6608 → custom weapon shield_id -1 → no shield all 0 values → keep normal default profile equipment After editing the DB, despawn and respawn the saved bot so M54 reloads its equipment overrides. Do not edit bot_id. Use it only to identify which saved bot the equipment row belongs to.   DOWNLOAD
    • It will be multi client so it will detect the client from the files and adapt the packets and asset loading. I am aiming for C4 and H5 after IL
    • this is just to simplify your life, time, and can be done for free by yourself just watch some tutorials, in case you don't wanna waste time check it out!   https://l2getwork.art   https://l2getwork.art/showcase.html  
    • Good job! Any chance for it to be downgradeable or at least compatible with older chronicles?
    • Fermata now runs in a web browser too. Try it here: https://web.fermata.gg/    
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..