I am using Glassfish 3.1 to serve static contents. The Client HTTP Get Requests are processed by Spring's Dispatcher Servlet with the parameter async-supported set to true. The static content are binary images of approx size of 50MB. My main concern with using Glassfish as static content provider was scalability until I stumbled upon the below parameter which set Grizzly in Async Write mode.
我正在使用Glassfish 3.1来提供静态内容。客户端HTTP Get请求由Spring的Dispatcher Servlet处理,参数async-supported设置为true。静态内容是大约50MB的二进制图像。使用Glassfish作为静态内容提供程序的主要问题是可扩展性,直到我偶然发现以下参数将Grizzly设置为异步写入模式。
-Dcom.grizzly.http.asyncwrite.enabled=true
After setting the above JVM parameter, I could see the worker thread being released quickly which earlier were being held for the entire duration of a file transfer.
在设置了上面的JVM参数之后,我可以看到工作线程正在快速释放,之前在整个文件传输期间被保留。
I am aware that I need to configure certain parameters (e.g BufferMemory, Acceptor threads etc) in order to make this production ready.
我知道我需要配置某些参数(例如BufferMemory,Acceptor线程等)以使这个生产准备就绪。
My questions are,
我的问题是,
- What are the effects of adding this JVM paramter.
- Is there a definitive list of parameters which I need to tune to make this work with lesser side effects?
- What are the alternatives to the above configuration.
添加此JVM参数有什么影响。
是否有一个确定的参数列表,我需要进行调整以使其工作副作用较小?
上述配置有哪些替代方案。
The official documentation are single liners and does not give proper examples.
官方文档是单行文档,没有提供适当的示例。
1 个解决方案
#1
Turns out that setting -Dcom.grizzly.http.asyncwrite.enabled=true
sets Grizzily in async mode. Of course you need to fine tune other parameters to make it production ready. Glassfish 4.1 comes bundled with asycn write mode.
事实证明,设置-Dcom.grizzly.http.asyncwrite.enabled = true会在异步模式下设置Grizzily。当然,您需要微调其他参数以使其生产就绪。 Glassfish 4.1捆绑了asycn写入模式。
#1
Turns out that setting -Dcom.grizzly.http.asyncwrite.enabled=true
sets Grizzily in async mode. Of course you need to fine tune other parameters to make it production ready. Glassfish 4.1 comes bundled with asycn write mode.
事实证明,设置-Dcom.grizzly.http.asyncwrite.enabled = true会在异步模式下设置Grizzily。当然,您需要微调其他参数以使其生产就绪。 Glassfish 4.1捆绑了asycn写入模式。