Hi
I put this issue on the back burner for a while but I noticed that you can up the threads in the GeoServer WPS Services console. The default thread count was set to 1. I was not aware of this capability and upping the thread count fixed the threading issue with GeoServer the python scripting. We are continuing to stress test the python scripts to see what the thread count should be set to.
Directions
Login to the Geoserver console (admin:geoserver)
Click on WPS, under the Services section
Scroll to the bottom and change the thread counts to 10
Click save.
I was wondering why we needed to up the WPS thread count for the python scripting calls but not for direct WPS calls? We make several WPS calls a day and have not run into threading issues.
Thanks!
Dominique Bessette
Engineer, Software
General Dynamics Information Technology
Supporting Fleet Numerical Meteorology and Oceanography Center (FNMOC)
Office: 619-881-2748
From: Bessette-Halsema, Dominique E
Sent: Wednesday, April 10, 2013 9:43 AM
To: ‘Justin Deoliveira’
Cc: geoserver-devel
Subject: RE: [Geoserver-devel] execute python scripting wps
Hi!
Here’s the jstack.
Thank You
Dominique Bessette
Engineer, Software
General Dynamics Information Technology
Supporting Fleet Numerical Meteorology and Oceanography Center (FNMOC)
Office: 619-881-2748
From: Justin Deoliveira [mailto:jdeolive@anonymised.com]
Sent: Wednesday, April 10, 2013 7:53 AM
To: Bessette-Halsema, Dominique E
Cc: geoserver-devel
Subject: Re: [Geoserver-devel] execute python scripting wps
Hi Dominique,
Can you provide the jstack output of the geoserver proess after it hangs, it will show us what all the threads are doing.
-Justin
On Tue, Apr 9, 2013 at 4:41 PM, Bessette-Halsema, Dominique E <Dominique.Bessette@anonymised.com> wrote:
Hi
I figured out the issue but not a fix. I call WPS Execute for the python scripting hook (wps#1), the python scripting hook calls a rest service, inside the rest service there is another WPS Execute POST (wps#2) to geoserver which posts xml (ie. JTS:intersection). I believe geoserver is waiting for the initial python scripting hook wps execute to complete before the rest service execute. The queue is wps#1, wps#2 and I need wps#2 to execute before wps#1 can finish. If I point the WPS execute to another geoserver everything works fine. Can someone please explain why this is happening (threads?) and Is there a workaround?
WPS Execute → python .py → REST service → WPS Execute
We created a workflow this way so we could dynamically add WPS’s to geoserver without restarting it everytime, and the rest service can pull xml out of the database and execute the xml so we wouldn’t have to create WPS’s in python code.
Thank You
Dominique Bessette
Engineer, Software
General Dynamics Information Technology
Supporting Fleet Numerical Meteorology and Oceanography Center (FNMOC)
From: Bessette-Halsema, Dominique E
Sent: Friday, April 05, 2013 3:44 PM
To: geoserver-devel
Subject: execute python scripting wps
Hi
First here’s some background on my project architecture.
Geoserver contains the python scripting extension
The python script under geoserver_data_dir/scripts/wps/ contains a name input, a string result, and runs a rest call to an outside rest service (ie. http://localhost:8080/restsvc/wps/execute/name)
The outside rest service then grabs a wps string from a database by name, and posts geoserver wps execute with the wps from the database to get the result.
Everything works fine if I run the rest service from a browser. The service grabs the wps and posts geoserver and returns the output string. But when I try to run everything through geoserver I don’t really get an error, but the browser keeps waiting for a response. I attached a log file that contains the logs from when I call the rest service directly and then through geoserver.
Call to run python script through geoserver:
http://localhost:8080/geoserver/wps?service=WPS&version=1.0.0&request=Execute&identifier=py:callRestSvc&datainputs=name=test4
python script rest call:
def run(name):
url=‘http://localhost:8080/restsvc/wps/execute/’
url+=name
f = urllib.urlopen(url)
return str(f.read(500))
Thank you
Dominique
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
–
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.