maxmilton / trackx

Simple, lightweight, and privacy-friendly error tracking.
https://trackx.app
MIT License
11 stars 2 forks source link

Getting database table stats slows down stats page #158

Open maxmilton opened 2 years ago

maxmilton commented 2 years ago

Generating information about database table sizes takes a huge amount of time once there's a moderate amount of event data. Not only does this slow down the /stats page, it could also be a potential vector for DOS attacks.

See:

maxmilton commented 2 years ago

My best guess is it's related to system resources, namely disk I/O performance.

Even so, we need to prevent it being abused and leading to DOS + it's a generally poor user experience. A first step could be splitting the data into 2 API calls; a separate one for the slow data and another for everything else.

maxmilton commented 2 years ago

For the time being the DB table stats are now behind a config option flag and disabled by default (#234). This is more of a workaround so I'll keep this issue open until we come up with a better solution.