How can I create over 14000 clients using HTTP (Tomcat) while HTTP is running over TCP, so the socket is created

The HTTP protocols work over TCP / IP. SO infact we can say that if we connect a client, i.e. whether it is TCP or HTTP, a socket is created and therefore a file is created. Tomcat works with HTTP.

In TCP, I can create 1024 clients at the same time. If I create more clients, I get too many file opening errors. But using Tomcat I can create over 14000 clients.

If I am using Tomcat then I am not using ulimit to increase my OS file limit.

How is this possible?

+1


a source to share


4 answers


I guess either ...

  • you are using tomcat with a user (not your interactive shell which is limited) that has a ulimit above 1024
  • your startup.sh script contains a ulimit statement.

To see if this has a later case ...

grep ulimit ./bin/*

      



Also tell us how you start tomcat and we'll get to the point! To see which user is running your tomcat try something like this ...

ps aux | grep tomcat | cut -d " " -f 1

      

The output will display the username and process ID. I'm sure this is different from what you are using.

+3


a source


There is a limit to the number of file descriptors a process is allowed to use. On Unix systems, a socket uses a file descriptor.



To overcome the 1024 file descriptor limit, you can use the ulimit command.

+2


a source


This is a limitation for your operating system how human resources can be exposed. Within * NIX, you can manage this limit with ulimit ( http://www.ss64.com/bash/ulimit.html )

+2


a source


When you say, "Using Tomcat, I can create over 14,000 clients," what exactly do you mean by "client"?

Is it possible that your application is simulating 14000 concurrent users (each of which can make, say, 1 HTTP request every 10 seconds to the server, each request takes 0.01 seconds, so tomcat only needs ~ 14 concurrent connections at any given time?

with will netstat -n|grep 8080

display all active HTTP connections to your tomcat (assuming you are listening on port 8080, adapt if not). This will let you see how many TCP connections you are actually using.

Could you please post more details on what your load testing program actually does? This can help you understand what you are seeing.

0


a source







All Articles