mapfish / mapfish-print

A component of MapFish for printing templated cartographic maps. This module is the Java serverside module.
http://mapfish.github.io/mapfish-print-doc/
BSD 2-Clause "Simplified" License
184 stars 417 forks source link

The last jobs will be done before the firsts ... #217

Closed sbrunner closed 9 years ago

tsauerwein commented 9 years ago

How did you notice this behavior?

I made a test-case with jMeter in which I start 100 print jobs in 10 seconds, poll the status and then request the report. Below you can see the order in which the finished reports where requested (for example request 4 was finished before request 1):

4
1
5
2
3
9
6
10
7
8
14
11
15
12
13
19
16
20
17
18
24
21
...
84
81
85
82
83
86
89
90
87
88
94
91
95
92
93
99
96
100
97
98

From this order I can not really observe that last jobs are prioritized. For sure you don't have the exact order in which the jobs were created as this is up to the scheduling of the operating-system.

sbrunner commented 9 years ago

I don't know what's wrong,but on http://geomapfish.demo-camptocamp.com/sbrunner/theme/Transport?debug If I click 6 times on print the down order is systematically: 0, 1, 5, 4, 3, 2 ! Notes that I have only one concurrent printing job.

tsauerwein commented 9 years ago

Notes that I have only one concurrent printing job.

Are you saying that you changed maxNumberOfRunningPrintJobs to 1?

sbrunner commented 9 years ago

Yes

tsauerwein commented 9 years ago

Why?

sbrunner commented 9 years ago

Out of memory errors ...

tsauerwein commented 9 years ago

There really was a problem with the comparator of the queue (see #225), but I would recommend you to increase the heap size of Tomcat so that you can run more jobs in parallel.

sbrunner commented 9 years ago

Effectively but actually it's not a goal to have more jobs in parallel, we will probably on near feature increase it to 2 but probably never to the default value, it create too many server load ...

jesseeichar commented 9 years ago

A print job ideally should not create such a great load if this is the case then we need to profile the application and optimize. It is critical that the system can handle hundreds of requests in parallel without causing problems.

Are the problems memory or CPU related?

Jesse

On Wed, Mar 25, 2015 at 5:50 PM, Stéphane Brunner notifications@github.com wrote:

Effectively but actually it's not a goal to have more jobs in parallel, we will probably on near feature increase it to 2 but probably never to the default value, it create too many server load ...

— Reply to this email directly or view it on GitHub https://github.com/mapfish/mapfish-print/issues/217#issuecomment-86118172 .