Thank you for viewing my post.
I'm running selenium-server-standalone as a windows service utilizing nssm(- the Non-Sucking Service Manager | http://nssm.cc/), utilizing the identical process as mentioned in this stackoverflow post #: https://stackoverflow.com/a/10656979/956863.
Quick Summary of post:
Download and extract nssm.exe
Installed NSSM and from the command line ran: nssm install Selenium-Server "C:\Program Files\Java\jre6\bin\java.exe" "-jar C:\Selenium\selenium-server-standalone-2.24.1.jar"
The machine where I'm running this process is running windows XP, service pack 3. This solution to run selenium server as a service works like a charm, and when selenium server is running, and crashes for some reason, selenium server successfully restarts without manual intervention.
But I"m coming into work, and am being informed by system administrators that high cpu alerts are being thrown. And again system logs are providing no information... So I'm wondering if selenium is actually the cause of this issue, and want to eliminate the possibility of running selenium as a service being blamed for this cpu spike.
Can anyone think of a solution, perhaps a way to stop the selenium service when cpu utilization reaches X amount? Or?
In the meantime, I'm going to set some sort of long term CPU utilization monitor and see if that can see something that the system monitor in xp may be missing. ( If anybody knows of a good way to achieve this, i'm open to suggestions as well )
I have selenium running as a service on windows 2008 server and noticed that its not able to clean up the headless browser instances. My tests are written in JavaScript with Soda so I have a start up and close out the browser instances but running as a service it doesn't close out those instances in the task manager.
I actually have two ways I'm running the service one way is where I'm using a bat file to run selenium the other way I have it running directly off a registry key.
I was able to fix the browser issue after I just added another step process to teamcity to run taskkill automatically on any browsers left open when the tests were complete. This fixed my CPU spiking issue.
Despite having vague reports of CPU spikes with Selenium as a service, I have yet to see one with my own eyes. Which version of Java are you using?
Our commercial run-anything-as-a-service product supports CPU tracking and can restart Selenium when it hogs the CPU. I suggest that you download the free 30-day trial and use it see if you can confirm or rule out Selenium as the problem in that time frame. Follow this guide to set up Selenium as a service.
Related
I have a java software that I made on Eclipse and during the execution there is a series of http requests and responses that I have to make. They run pretty smoothly on Eclipse (using the org.apache.http library) but, when I export to a runnable jar, it's painful to see the time it takes between each http connection. I can almost say that the execution takes roughly 10x longer. I'm on the same JRE and I'm using the same parameters I use to open eclipse ( -Xms40m -Xmx512m).
JVM console shows that Eclipse spawns 5 threads to handle my program. The runnable jar uses 9 daemon and 1 user thread.
Can anyone help me figure out the issue here?
Thank you.
Diagnose the network latency. Trying pinging the host you are trying to connect from the machine that has eclipse running, and the machine that you are running from the jar.
I have a Java application which should run on a server machine in the background (the application can be started by a command without GUI). The problem is: When I log off from the server, the application gets killed. I'm looking for something similar like nohup under Linux. I found some solutions, but I'm unsure, what is the best for my situation (Windows Server 2003, Java Application run from BAT-Skript, restart after booting the machine)? What are the pros and cons of the solutions?
psexec: Do the process really need to run under the SYSTEM account?
Combination of instsrv and srvany: But srvany should should never be used in a production environment
I have started the application with the scheduled tasks with the option run as NT AUTHORITY\SYSTEM. But after log off, the application was still killed. Can I get this working?
The DOS Task Scheduler AT command
Write a windows service (on Java, C# - I don't think it does matter)
Start the app from your service
or
Run your app as a window service using 3d party utility
The only way in which you can get a process to run without a user being logged in is to have the process run as a windows service or at the very least called by a windows service.
Just to add to above answers.
Consider using http://wrapper.tanukisoftware.com.
It's rather mature and popular (in contrast to ServiceEx and RunAsService).
Yes, a Windows Service is definitely the way to go but there are a few things to watch out for when you run a Java application as a Windows Service. Most of them are covered in this tutorial showing how to setup a java application with our commercial run-anything-as-a-service application, AlwaysUp:
http://www.coretechnologies.com/products/AlwaysUp/Apps/RunJavaApplicationAsAService.html
Beware: You will almost surely need the "-Xrs" flag on Windows 2003 to prevent the closing-on-logoff behavior but things can get tricky if you are catching shutdown events. Let me know if that is an issue for your situation.
We have a java based application that runs as an applet in internet explorer. One of the things that this applet does is load a dll that is used to launch a third party piece of software. One of our clients has deployed our application in a Citrix environment. Only with this client, (who is also the only one running Citrix) do we see a problem where, intermittently, CPU spikes on the Citrix server to 100%. When we use process explorer to see what is happening, I see that the culprit is MSVCR71.dll. How do I solve this problem?
After almost five weeks of effort, I found the answer to this problem. It had nothing to do with Citrix, nor did it have to do with loading a third party piece of software. What happened was that I was disposing a JDialog box twice. The second time I disposed it, the system seized and spiked the CPU.
I have a java GAE web app with datanucleus as the JPA provider. When deploying locally on my machine - the deployment hangs (takes minutes). Looking at the task manager I have a javac process running. Any idea what is going wrong?
Agreed. Its the problem with GAE as it takes a 6permutation Compilation only after which the application would be deployed and shown on the browser. I feel its the problem only with GAE and not JPA. I have developed a similar app and if you feel its because of JPA, you can check the corresponding database admin to see how many threads are being opened for the user. If you seem to find some aren't Garbage collected, check your code. Else you can use ConnectionPooling mechanism (to speedup db retrieval using ORM).....
The answer depends on several parameters
How you deploy, are you using eclipse or command line?
GAE version (and GAE/GWT eclipse plugin version)
Windows or Linux?
In any case, a Thread Dump can help seeing which non daemon threads are stuck.
For command line deployment in Windows - press CtrlBreak after it hangs to get the thread dump
In Eclipse, if there is a way to deploy in debug mode, look at the debug view stack for the same info
See this answer as well: How to Force Thread Dump in Eclipse?
This thing depend on which platform u r using
Windows
linux
mac os x
you can check what is going on by checksignal
sending a signal
Usage:
SendSignal <pid>
<pid> - send ctrl-break to process <pid> (hex ok)
You can get the source via anonymous CVS at
cvs -d :pserver:anon#www.latenighthacking.com:/code-cvsroot co 2003/SendSignal
I have recently deployed my simple application in google app engine via eclipse. It failed to deploy couple of times. after sometime, It deploy successfully. I was able to access the application. if it hangs, stop the deployment process and redeply
I'm trying to run jstack command on my java application. Application is rather big, running inside jboss AS occupying about 4gb of memory. OS is Windows Server 2003 Standard edition. Every time i get an error "Not enough storage is available to process this command". There is enough ram, 16gb, and disk space. So, any ideas?
I ran into this recently on Win2008r2 and thought I'd share my solution since it took a while to figure out. Rob's comment about psexec -s is what did it for me.
It appears that on Vista and later jstack doesn't work against services because of the user context. It has nothing to do with memory. I suspect this is the same reason people have seen this problem on 2003 via remote desktop, unless you use the /admin or /console switch on mstsc. As of Vista the tightened security is probably what broke it.
Starting my app from a cmd window worked fine, but that doesn't help me debug our standard install. Enabling the java debug port (for VisualVM, Eclipse or most any Java debugger) requires an app restart, so you lose the state you're probably trying to capture if you don't already have debugging enabled. Starting the service under my user credentials did not work - I was a little surprised at that. But psexec -s runs jstack from the system context, which worked like a charm. Oh, and you'll need to run psexec from an elevated cmd prompt, if UAC is on.
In the past I have seen this when the JVM is running as a Windows Service on Windows 2003.
First, check to see if this is an issue with the TMP directory.
Second, jstack (or the other utilities like jconsole) will not connect to the local process unless it is running in the same session. If the service is running as a specific user, you may be able to connect by logging into the same session. If you are using Remote Desktop, you can connect using "mstsc /admin" (used to be /console) and try to run jstack again. Definitely check to make sure the TMP directory is set properly if this doesn't fix the problem.
If the service is running as LocalSystem, the above procedure probably will not help much. I don't know if there is a way to log into the same session as LocalSystem.
Some other alternatives may be to set the process up for remote monitoring and use jvisualvm (from the server itself or another machine) to connect over a port and do a thread dump.
We had problems running JStack on a Windows machine with even a modest application (1GB). We ended up doing our stack and heap analysis using Netbeans. This seemed to cope with the parsing of dump files a lot better. YMMV.
Give Netbeans a try for profiling - its very good. Note that VisualVM is a cutdown NB profiler and comes with 6u7.
psexec -s jstack PID >> c:\jstack.log perfectly works on the same machine. For the first time it took some time but again I executed with the redirect to file option, it completed with in few seconds.
This is an error message from the underlying O/S. There's not much you can do in your code to deal with this other than catch the exception which is thrown. Boo to Windows for being so limited.
http://technet.microsoft.com/en-us/library/cc978735.aspx