more graceful shutting down, message delay down to 1s. long[] causes to
save memory. only keep best 1k recommendations to save memory.