1

I have a Windows Server 2008 64 bit machine with 16GB of RAM and 8 cores (AMD Opteron 2.0GHZ). The problem I'm having is Tomcat takes over an hour to unpack and run a .war file. Are there any Tomcat settings (6 or 7) OR Windows Registry/Regular settings to speed things up? The processor is only using 13% when unpacking and only 130,000K of Memory. I can deploy the same .war file on a much less powerful (dual core processor 2GB of RAM) and it will be ready to go in about 5 minutes. I suspect the issue is Windows and not Tomcat, since I use the same default install of Tomcat and it will deploy quickly on a different machine. However, the specific client's machine that I'm deploying on is very slow (two machines, development and a production server that are both slow).

  • 13% ~= 1/8. Is this tomcat unpack process single-threaded, or only granted affinity on one core, perhaps? ... Because that's what it looks like the problem is at first glance. – HopelessN00b Feb 6 '14 at 20:26
  • I assume its unpacking locally. Is the drive/drive array busy? What are you installing from (media/USB/local)? – MikeAWood Feb 7 '14 at 1:39
  • Yes, it seems like it's only using 1 core. How can I change that? Is that a tomcat or Windows setting? The drive array should not be busy. It's not a VM, it's a physical machine with the .war on the same array (it's loaded in via ftp and then moved into the Tomcat webapps dir). – Brandon Wagner Feb 7 '14 at 1:46
  • Processor affinity can (generally) be controlled either by the OS or the application, but the easiest way to check if it's Windows limiting your application is to use task manager, select the process, right click and select Set Affinity... from the context menu. Every CPU or core that the application is permitted to run on will be ticked. The rub is that just because the OS will let an application run on any or every core, does not mean the application will, or will be able to. I tried to find some info on parallelism and affinity with TomCat, but came up empty, so that's all I have. – HopelessN00b Feb 7 '14 at 21:54
  • Thanks, I'll set priority and affinity through task manager. I will post back my findings. If anyone has other suggestions let me know! – Brandon Wagner Feb 7 '14 at 23:56
1

Turns out this issue was related to the Virus scanning on the machine. Tomcat is limited to a single core when unpacking the .war file, but the scrubbing was making that process take a long time. Upon a more in-depth look at the full deployment of 45 minutes, I saw that the processor did get to higher percentages after the application was fully unpacked and it was actually started. Server admin set the Tomcat directory as an exclusion. This is fine for my application because we do not have user uploaded content within the Tomcat directory. Although, there could be other security implications depending on who is giving you the war file, so if you are experiencing this issue and want to exclude the Tomcat directory, make sure to evaluate the security implications.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.