I tried disabling the Who's Online block and the number of queries dropped to 10 or 11. Wow that's such a big difference!
The Who's Online block is very useful and informative and I want it to be accessible to the registered users. So may be I'll cache it for 30s or something. But I know some weird effect may appear because of this caching.
During peak time, my site gets over 150-200 or more visitors on the main XOOPS pages and over 200-300 in the forum alone. And the number will only gets bigger in the coming weeks due to the seasonal nature of my website.
Earlier today my server crashed and I have to repair the xoops_session table as a result. I hope this didn't cause the problem. Is there a way to optimize the Who's Online block besides caching?