Open chrisknoll opened 1 year ago
As I've been diagnosing different performance problems, I'm watching our db activity. I've been testing polling intervals, and other interactions, and i'm seeing very high 'toples out' and 'block I/O' on our server:
If I'm reading this chart right, there was a blast of 6 Million tuples out in that 1s interval. This doesn't seem right.
One item from discussion of this issue: we should publish a script that is useful for cleaning out older jobs to limit the size of the job table to help performance.
Another thought here from discussion on the Atlas WG - @chrisknoll observed that sometimes the 1st query to get notification status does not finish and a 2nd query is fired off. We could change the client-side polling such that subsequent requests for getting the job status (via the notifications) waits for the original query to finish.
It is possible the newer versions of Spring Batch will have already resolved this performance problem so linking this to #2244.
From discussion on Atlas WG, there may be potential issues w/ notifications via Atlas whereby calls to get notifications are queued while the job status query executes.
Expected behavior
We should see only periodic queries against the WebAPI DB for job execution status.
Actual behavior
When logging is enabled, we see a constant barrage of
SELECT JOB_EXECUTION_ID, KEY_NAME, TYPE_CD....
in logs.Steps to reproduce behavior
Set up a maven profile that will enabled hibernate and jdbc debugging like so:
Make sure this profile is active, and you recompile your WAR. Then launch the app. You will see this flooding the console:
One specific line that I saw:
The
LIMIT 1 OFFSET 16599
is odd here as well. Why would we select 1 job after the 16599th?Note the individual queries looking for
JOB_EXECUTIONID = ?
. The issue is: why is it querying for specific job executions when the only thing happening is getting a list of job statuses (presumably)?You will need to have many jobs in your spring-batch tables: we have over 30,000 jobs.