Web server refactor #17
Replies: 2 comments 6 replies
-
We don't have any stock service pool component, but we do have some similar usage patterns at TxManager. It serves as a scalable "job router", orchestrating concurrent tasks across multiple object stores and using the "clientCache" circular array as a Client pool. |
Beta Was this translation helpful? Give feedback.
-
Pooling isn't just about avoiding allocating and initializing the object. One of the reasons to pool objects is because of the caches of useful data that those objects accrue over time. If the request-servicing objects (these services) are lazily building cached state over time, then it makes a lot of sense to pool them. Also, if there is a fixed maximum, and if these are viewed as "manageable", then it may make sense to pool them, so that their stats can be aggregated over time (stats managed by each individually). My gut feel is that these make a lot of sense to pool, but that and $.50 isn't enough to get a coffee these days. And our goal is definitely to make service creation/destruction almost as cheap as a typical object. Obviously, it will never be quite as cheap, but it should be close. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Whilst the current web server code works, it is basically a POC to prove we could create a functional web server and handle basic requests in Ecstasy. There is still substantial work to do with refactoring to make better use of what Ecstasy can provide.
One particular area I wanted to kick of a discussion on is how to make the server more scalable, based on using services. Looking at other web servers, particularly in Java as that's what I have most experience with, they seem to follow a pattern of having a single thread that pulls the requests off the wire and then puts these requests into a queue where a thread pool handles them. I'm guessing in Ecstasy we can do something similar with a service that takes the requests of the wire and then a pool of "handler" service that process these requests. I could come up with code to do this, but is there already anything in Ecstasy that does anything similar, i.e. the service pool bit? I don't want to end up duplicating something that might already exist.
Beta Was this translation helpful? Give feedback.
All reactions