Raize Support wrote:If you create a logger for each server module (16 of them) and set the Category for each server module logger when you create them, why would you need to set the Category again at the entry of each server method?
But with all that said, your last sentence suggests that new instances of the server modules are created for each user (up to 16x). Is that correct?
Up to 16 server modules per user, correct. Since each user has a separate server module instance, that could lead to a couple of thousand logging objects allocated. In that scenario, I could just set the Category once. But I expect the overhead of setting the category before calling EnterMethod is less than the overhead of having a separate logging object instantiated for every server module instantiated.
Brief overview of current architecture:
- 16 Server Modules
- Each user has a dedicate thread
- Each user will access a minimum of 3 server modules, up to 16 if the user hits every area of the application
- Currently, a server module lives until the user that created it logs out
- The next version will implement an object pool for the server modules. Some tuning will be done to find the optimal use of the object pool. I expect CodeSite will be very instrumental in that tuning process.
Our largest customer has 160 simultaneous users. So here are the options that I'm weighing:
- Use only the built-in CodeSite logging object.
- One logging object per user/thread (up to 160, until we get a larger customer)
- One logging object per server module instance (up to 2,560)
The third option isn't even a consideration for me. I see zero benefit. I also expect that configuration would be more likely to become unstable.
So I'm trying to decide whether to use a single CodeSite logging object or one per thread. In either scenario, the logging object can/will be used to log from any server module instance at any given time. I was thinking that one object per user/thread would have some advantages.
The decision would be easier with knowledge of the CodeSite logging class, in particular how much (if any) serialization has to be done for thread safeness.
Since the application server already has one thread per user anyway, creating one logging object per thread doesn't create much overhead. If there would be any performance benefit at all, it would be worth it.