We have the RequestLogsFeature enabled and have noticed that it can and will bring our db to it’s knees. (postgresql xlarge on amazon) with 100% CPU usage.
One thing I notice that I can’t figure out is there is an insert followed by a full select of that record. This takes on average 1-2 seconds. I understand the insert but not the select.
What’s the reason for the select?
We’ve temporarily had to disable all indices and likely logging all together.
You can see there are just as many selects as there are inserts. Now, they are a small fraction of what the inserts are. This snippet is more recent where avg times have decreased due to lower site usage for time of day, but at peek we are getting 1-2 seconds.
Are you using your own DB MemoryLogger? ServiceStack comes with 3 Request Loggers:
CsvRequestLogger
RedisRequestLogger
InMemoryRollingRequestLogger
None of which logs to a database, so I’m assuming you’re using your own custom IRequestLogger? The Select is likely a result of you using Save() which checks to DB to see if it already exists, instead of Insert() which inserts without checking.