goware / oom

Middlewares for chi that help you survive running out of memory
MIT License
11 stars 1 forks source link

Is this library compatible with chi 2.0? #1

Open msaron opened 7 years ago

msaron commented 7 years ago

I am currently using the chi 2.0 router. I had a couple of questions.

  1. Is this library compatible with chi 2.0?
  2. Can we specify the memory in absolute units, such as 8GB instead of a percentage?

Thanks.

msaron commented 7 years ago

I am coming from a NodeJS background where I used the hapijs framework developed and used by Walmart to drive their website. One feature it has is that you can set the RSS size; see their api description on the settings here. This is the functionality that I would like oom to have. Here is what the hapijs api documenation says about setting the server or connection load:

The maxHeapUsedBytes and maxRssBytes settings can be applied to the server as a whole OR per request OR both. This is incredibly useful and powerful! It can probably be incorporated by using golang context (not sure about this as I have just come into golang from NodeJS)?

If all this can be incorporated into oom, it would make it incredibly powerful.