Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve scalability of HttpCookieStore.Default #12663

Open
sbordet opened this issue Dec 27, 2024 · 1 comment
Open

Improve scalability of HttpCookieStore.Default #12663

sbordet opened this issue Dec 27, 2024 · 1 comment
Assignees
Labels
Bug For general bugs on Jetty side Sponsored This issue affects a user with a commercial support agreement

Comments

@sbordet
Copy link
Contributor

sbordet commented Dec 27, 2024

Jetty version(s)
12.0.x

Description
HttpCookieStore.Default uses a lock to protect the data structures holding the cookies.

However, it is rare that cookies are added, and much more common that cookies are read, so it should be a good case to use ReentrantReadWriteLock.

@sbordet sbordet added the Bug For general bugs on Jetty side label Dec 27, 2024
@sbordet sbordet self-assigned this Dec 27, 2024
@joakime
Copy link
Contributor

joakime commented Jan 7, 2025

Another change you can add, for performance reasons, is the limits outlined in RFC6265: Section 5.3 - Storage Model.

   At any time, the user agent MAY "remove excess cookies" from the
   cookie store if the number of cookies sharing a domain field exceeds
   some implementation-defined upper bound (such as 50 cookies).

   At any time, the user agent MAY "remove excess cookies" from the
   cookie store if the cookie store exceeds some predetermined upper
   bound (such as 3000 cookies).

50 cookies max per shared domain.
3000 cookies max per cookie store.

Configurable, of course.

@sbordet sbordet added the Sponsored This issue affects a user with a commercial support agreement label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side Sponsored This issue affects a user with a commercial support agreement
Projects
Status: No status
Development

No branches or pull requests

2 participants