FWIW i'm not sure if this applies to your code or not, but a few things to look out for in writing server-side libraries in pyramid:
1. make sure you're only 'writing' the session once (a few libraries had written on each change)
2. a few libraries have done a preliminary check to see if a session exists. it's best to just "load", and create a new session on a load exception
3. it's also best to only write/create a session if you have data to store (or edit). a handful of libraries will create a session by simply accessing/inspecting the `request.session` property.
4. i found it useful to fingerprint a serialized version of the session, and detect changes on nested data by that. that overhead was much smaller than the load on Redis to store sessions that didn't really change.
i've had problems in the past with spiders/bots nearly taking a site offline from the effect of 100k+ hits in the span of a few minutes... each one generating a new session.