Jump to content
  • 0

Server doesn't want to allow more than 1024 connections


Neslea

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   3
  • Joined:  07/18/13
  • Last Seen:  

Hello dear rA people.

We've reached more than 1024 players on our server and whatever we do, the server doesn't want to allow for more.
 
At first, players used to get "failed to connect to server" as their connection was denied, we immediately thought it was the socket limit on the server. So we wanted to fix it by changing :
 
 
/etc/security/limits.conf

 

 root               hard    nofile       40000
root            soft    nofile          40000
*               soft    nofile           10000
*               hard    nofile          64000

 
/usr/include/x86_64-linux-gnu/bits/typesizes.h to 4096
/usr/include/linux/posix_types.h to 4096
 
ulimit -Sn 65535
 
# nano  /etc/pam.d/common-session
# nano /etc/pam.d/common-session-noninteractive
ADD -> session required pam_limits.so
 
defined FD_SETSIZE to 4096 and recompiled.
 
We also changed 
 
max_connect_user: 9999
and
 
Change - packet_db.conf
// If IP's are checked when connecting.
// This also enables DDoS protection.
enable_ip_rules: no

 

because why not.

 

 

But then now, the map server crashes whenever we reach 1025 sockets.

For your information, in the console it writes clearly "rathena, this client supports 4096 concurrent connections"

 

What did we do wrong?

 

Server is under Debian 8.

We run the live server on a docker under Ubuntu last version.

 

 

Thanks a lot for anyone who can help.

Edited by Neslea
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  805
  • Reputation:   230
  • Joined:  01/30/13
  • Last Seen:  

Could be that there is some hard-coded 1024 limit somewhere in the code that would cause an overflow. Can you get the line at which it crashes?

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   345
  • Joined:  02/26/12
  • Last Seen:  

Could be that there is some hard-coded 1024 limit somewhere in the code that would cause an overflow. Can you get the line at which it crashes?

 

GDB?

./configure --enable-64bit --enable-debug=gdb

And post output here.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   3
  • Joined:  07/18/13
  • Last Seen:  

 

Could be that there is some hard-coded 1024 limit somewhere in the code that would cause an overflow. Can you get the line at which it crashes?

 

GDB?

./configure --enable-64bit --enable-debug=gdb

And post output here.

 

 

We enabled GDB. It didnt give any log. And all it did was creating random crashes on map server. Once we turned off GDB no crashes happened anymore.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   345
  • Joined:  02/26/12
  • Last Seen:  

  1. gdb map-server
  2. r

And when server will crash, you will see full output why it crashed.

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  1
  • Reputation:   0
  • Joined:  10/13/15
  • Last Seen:  

Your forgot the Maxconn setting when compiling.

Try that ;)

 

https://webcache.googleusercontent.com/search?q=cache:AAbyx6AyfsQJ:https://searchcode.com/codesearch/view/36787813/+&cd=7&hl=en&ct=clnk&gl=us

Line 668.

: --with-maxconn[=ARG] optionally set the maximum connections the core can handle (default: 16384) NOT USED YET - EXPERIMENTAL

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  4
  • Reputation:   0
  • Joined:  07/28/16
  • Last Seen:  

Hello dear rA people.

We've reached more than 1024 players on our server and whatever we do, the server doesn't want to allow for more.

 

At first, players used to get "failed to connect to server" as their connection was denied, we immediately thought it was the socket limit on the server. So we wanted to fix it by changing :

 

 

/etc/security/limits.conf

 

 root               hard    nofile       40000
root            soft    nofile          40000
*               soft    nofile           10000
*               hard    nofile          64000

 

/usr/include/x86_64-linux-gnu/bits/typesizes.h to 4096

/usr/include/linux/posix_types.h to 4096

 

ulimit -Sn 65535

 

# nano  /etc/pam.d/common-session

# nano /etc/pam.d/common-session-noninteractive

ADD -> session required pam_limits.so

 

defined FD_SETSIZE to 4096 and recompiled.

 

We also changed 

 

max_connect_user: 9999

and

 

Change - packet_db.conf

// If IP's are checked when connecting.

// This also enables DDoS protection.

enable_ip_rules: no

 

because why not.

 

 

But then now, the map server crashes whenever we reach 1025 sockets.

For your information, in the console it writes clearly "rathena, this client supports 4096 concurrent connections"

 

What did we do wrong?

 

Server is under Debian 8.

We run the live server on a docker under Ubuntu last version.

 

 

Thanks a lot for anyone who can help.

 

 

Sir, how did you recompile the FD_SETSIZE?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...