How would running a Sentry client and server in the same webapp affect performance?
I'm looking into setting up Sentry for my Django project, but I was wondering whether to install the Sentry server along with my main webapp, or in a separate web instance.
The benefits I can think of for having Sentry in the same webapp would be:
- Ease of setup and maintenance (one webapp instead of two, and not needing to install eventlet, etc.)
- Ease of use for admins (e.g. logging into Sentry with the same accounts as the webapp admin)
The Sentry docs suggest here and here that running it in the same webapp will bring down the webapp quality of service, but how, specifically?
- Could Sentr开发者_运维知识库y slow the webapp down when no errors are occurring?
- Could the webapp become extremely slow if many errors are occurring (say, 10 per minute)?
Sentry doesn't do anything unless an error occurs, and even then, the impact on response time is negligible -- well, at least as negligible as any other type of logging on the system. In general, though, this is not going to have an effect on your app.
The scenarios the docs refer to where integrated Sentry would be a problem are in high-concurrency environments and those where QoS (quality of service) is a must. Let me go into those in a bit more detail.
First, high-concurrency. Here, your website is getting so much traffic that 1) you must strip the server to bare bones just to handle requests (think Twitter or Facebook) or 2) the load is sufficient to bring your server to its knees (Digg-effect, though that probably needs to be renamed now), in which case you'll lose Sentry access as well.
Second, QoS impact. Mixing apps on a server means more points of failure. If there's a bug in your Django project, it can potentially take down Sentry with it, making it much more difficult to diagnose. Or conversely, if something blows up in Sentry, it might take your Django project down with it, resulting in potential lost visitors, sales, ad-revenue, etc.
The issue really isn't so much performance (although that is important), it's really about separation of duties and reducing points of failure. If you're running a small site, that's probably not of much concern to you. But, for sites like Disqus (who make Sentry), a segregated Sentry server is a necessity.
精彩评论