I use Glassfish v3 for serving large files (glassfish is used for business logic as well - FYI) I am aware that Glassfish frontends with Grizzily web-server. I use Grizzily in synchronous mode. Meaning, if there are 100 threads only 100 downloads are allowed. Rest of the requests will be queued. However, I want to set 503 for the HTTP clients which cannot be served due to lack of worker threads (100 max).
Question
Usually these are container specific features. You can configure the requests queue size using the property server.http-service.connection-pool.max-pending-count = 100
. All requests beyond 100 will be rejected.
For more information, refer here: