improve checkCacheSize() and increase P2P_TIMEOUT