Symptoms
K2 Workspace is unavailable
Diagnoses
Such system behavior usually indicates that some process or processes exceed maximum threads limits configured on K2 server (by default Async and IPC threads both have limit of 5 threads configured). Also as upper part of workspace is visible and responding - we may infer that IIS and authentication are not an issue here.
Resolution
Select all processes from Server.ProcInst table with status 1 (Running), and assign them random number (anything above of 5 will do for this) as a status and restart K2 service - this should make K2 Workspace available again.
After this action it is possible to check which process exactly caused the issue and depending on investigation results either adjust process design or increase max thread limits.
Additional details/considerations
Number of the processes with Status 1 in the Server.ProcInst table by itself is not a problem, as such problem may be caused by one "misbehaved" process.
Good check here is to verify if there are any processes which are constantly in Running state (Status=1). This can be done in a following way:
Run SQL query
SELECT * FROM Server.ProcInst WHERE Status = 1
If you constantly monitor this you should be able to tell if a process is constantly in running state.
Then when you identified process (or processes) in constant running state:
Stop K2 service
Set the status of item to 10
Then start the service.
Another good check is verify state size for processes. Anything with state size above 1000000 is greater than 1Mb and causes huge spikes.
Because such processes had been through a great number of repetitions, the state size and version numbers are very high compared to the other processes on the server. By executing the following query it is possible to see this very easily:
SELECT TOP 200 ID, DATALENGTH(State) AS StateSize, Version, StartDate, Originator, Folio, Status
FROM
Server.ProcInst WITH(NOLOCK)
WHERE
Status IN (1, 2)
ORDER BY
DATALENGTH(State) DESC
Related documentation
Details of ProcInst table structure:
https://www.k2.com/onlinehelp/k2blackpearl/devref/4.6.7/K2 blackpearl ServerLog Database ERD.pdf
K2 Server Thread Pools settings:
http://help.k2.com/kb001446