Deep Storage
Deep Storage is the #1 source of lag when using bLogs. Whilst it has been created with performance in mind, due to the nature of Gmod Lua (which can typically only run on a single thread on a single CPU core), a few things should be paid attention to to maximise performance:
What is Deep Storage?
Deep Storage is how bLogs stores logs into an SQL database for viewing after a server restart or (for MySQL-using servers) historical log viewing.
By default, bLogs commits all uncommitted logs to deep storage every 60 seconds. This means that for some servers, every 60 seconds you may experience a noticeable jolt/freeze while the server commits logs to the database.
This system works better than committing every log to the database the moment it's created, as this will just reduce your server performance 100% of the time, rather than every 60 seconds. This would be especially bad during times of high server activity, where logs are potentially being created extremely frequently.
Optimising Deep Storage
1. Use MySQL
Using MySQL is crucial for bLogs' performance as a whole.
By default, bLogs uses your server's flatfile database, which is located in garrysmod/sv.db and uses SQLite. SQLite is actually great for storing logs and storing things quickly, but because it uses a file to store the data, the disk must be written to quite frequently, causing freezes and lag spikes. Furthermore, the Lua interface for this SQLite database is synchronous, as opposed to MySQL, which is asynchronous. What this means is that when you want to update the SQLite database, everything on the server must hang until the operation has completed, whereas with MySQL, the operation is simply sent off to the remote server for processing in the background or on another CPU core/thread.
2. Choose an appropriate commit time
bLogs commits logs to deep storage every 60 seconds by default, you can increase this value in-game config in the bLogs menu.
Increasing this value will reduce the frequency of these lag spikes, but will take longer for the lag spike to clear away.
3. Reduce the latency between MySQL and your Gmod server
If you're using MySQL, you should use a MySQL server that is local to the same machine (highly recommended.)
However, for most hosts, the MySQL server may not be on the same machine. If the machines are in the same data centre, you probably have nothing to worry about.
BUT - if your MySQL server is in a completely different country (for example), you probably need to worry! It will take significantly longer for the packets to travel through the Internet to your Gmod server.
4. Choose appropriate hardware for your Gmod server and MySQL server
https://www.gmodstore.com/help/addon/6016/lag-optimisation-performance/server-hardware
5. Turn Deep Storage off entirely
If you cannot acquire a MySQL server, or simply don't need to use Deep Storage, you can turn it completely off in the in-game config in the bLogs menu.