On 2016-11-15 07:02, Mikhail Savushkin wrote:
> Metrics are:
>
>
> """
> DBs in Pool RSS, kBytes Added to memory, kBytes
> 0 65,020 -
> 1 86,576 +21,500
> 2 105,520 +19,000
> 3 114,520 + 9,000
> 4 123,708 + 9,000
> 5 132,444 + 9,000
> """
>
>
> And regarding the efficiency - thats why we wanna use "maps", possibly stored in some Redis.
>
> Btw, we would be totally happy to just store the entire Pool in Redis and fetch it from Redis per request, but as far as I get, serializing Pool is practically impossible.
>
>
> As long as we're talking about millions of DBs, this straightforward
> approach wont work.
On a standard Tryton setup, you should have about 500 classes and I
think the standard RPC call will use at least 20 classes. I do not think
you will have a huge gain by limiting the number of classes you setup in
the pool. Indeed I think you should focus on speeding the init of the
Pool for a database (and implement a garbage collection of unused DB).
Also you could try to dispatch request for the same DB to a subsets of
server.
By the way, did you test with this changeset:
http://hg.tryton.org/trytond/rev/f1cbb165eefa
Here are some places where I think there could be improvements:
- Cache the result of create_graph. This is build using only static
data.
- Cache the module_list to avoid querying the database, needs to be
cleared when a new module is activated (on update)
- Improve the __setup__ methods:
- find better than deepcopy:
http://hg.tryton.org/trytond/file/default/trytond/model/model.py#l46
- idem for ModelView
- Improve the __post_setup__ methods:
- _defaults could maybe be removed
- idem for _fields (or maybe filled on the first uses)
PS: Please do not top-post on this mailing list, see
https://groups.tryton.org/netiquette