josef(dot)machytka(at)gmail(dot)com writes:
> Sometimes some session goes into some kind of "drowsy" state and runs
> incredibly slowly. It causes some very low disk IO and runs like 20x slower
> then usual.
Is it using a lot of CPU time according to ps or vmstat?
> Do you please have any advice what to check or what setting might help?
If it's eating CPU time, try using "perf" to find out where.
regards, tom lane