Skip to content

Performance Considerations

jagauthier edited this page May 1, 2017 · 4 revisions

There are a few options that can be used that will considerably impact performance for database inserts.

--db-threads DB_THREADS
                    Number of db threads; increase if the db queue falls
                    behind. [env var: WHSRV_DB_THREADS]

The default is 1. However, any time your database gets under stress, the queue will back up. A queue in itself is not a problem. A problem is a constant queue. A spike may represents an anomaly (database backup, alter table, etc)

Increasing this will allow more database insert threads. If you are running a high load, increasing this will be a must.

-ig IGNORE_POKEMON, --ignore-pokemon IGNORE_POKEMON
                    List of Pokemon to ignore when received. [env var:
                    WHSRV_IGNORE_POKEMON]

This will ignore pokemon coming in on webhooks that match your list. They are not saved, and they are not resent to webhooks.

-pi POKEMON_INSERTS, --pokemon-inserts POKEMON_INSERTS
                    Number of pokemon to commit to the DB at once. Bulk
                    inserts are faster than singles. [env var:
                    WHSRV_POKEMON_INSERTS]

When considering the incoming transactions of pokemon, gyms, and gym details pokemon by far outweigh the rest. This option will retrieve the pokemon webhook, forward it on, but not store it in the database until the specified number of pokemon has been reached. In my testing, pokemon can come as quickly. Setting this up will increase insert performance drastically.

A good balance between db-threads and pokemon-inserts should allow for some good scalablity, One thing worth noting: If you set pokemon-inserts too high (no quantifiable number variable) your map may lose data when you have to stop/restart it. Those pokemon are unwritten until the threshold is met.

Also, in the realtime statistics, pay attention the the maximum queue. Process and stat should be < 10. If process queue goes up, then increase --process-threads

You can figure out which options work best for by testing it out.

Clone this wiki locally