It's about following topic "Multiprogramming level (-gn server option)"
Quote from the article "When the number of tasks in the server Exceeds the multiprogramming level, the outstanding tasks must wait until a currently-running, or active task completes, by default its about 20 tasks"
I don't want that too many tasks in the queue... Where can I check whether the value has already been exceeded? Is it possible to find out the current number of tasks? I mean not the default I have already checked and currently stands at 20
Exact answer to the question you asked: SELECT PROPERTY ( 'ActiveReq' )
Short answer: This query will tell you the number of server workers that are currently handling client-side requests (ActiveReq) and the number of requests that are currently queued up waiting for an available server worker (UnschReq)...
SELECT PROPERTY ( 'ActiveReq' ), PROPERTY ( 'UnschReq' ); PROPERTY('ActiveReq'),PROPERTY('UnschReq') '20','12'
Long answer: Be wary of changing -gn. The default 20 was carefully chosen to be a good value under most conditions.
In particular, if you are having performance problems, and you notice that UnschReq is sometimes much larger than zero, do not expect that a larger -gn will always guarantee success.
Here is an example of a SQL Anywhere 10 database with 83 connections, 40 of which are extremely busy doing updates. The following Foxhound screenshot shows performance statistics (including ActiveReq and UnschReq) captured every 10 seconds with the most recent sample at the top.
The first test (at the bottom) used -gn 20, and the second test used -gn 40. The UnschReq value did drop almost to zero in the second test, but there was no significant change in either Latency or Throughput... in other words, UnschReq got better but the users didn't notice.