-
Notifications
You must be signed in to change notification settings - Fork 71
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
Add session pool #222
Add session pool #222
Conversation
Add tests
Fix multithread bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job
Hi @Aiee Thanks for developing this as it reduces session Aquire time.
What I found was it takes So if if we use Why it has doubled up the time as we just extended the connection pool? And why time is getting reduced if we increase the MinSize is it because sessions are already created in the background? And What is the ideal value for that MaxSize and MinSize? Thanks, |
@Aiee sessionPool.Execute() time is increasing as the number of vus increase. Using k6 Ex:- FETCH PROP ON Person "Bob" YIELD properties(vertex) AS Result
Thanks, |
Hi @akhilravuri2, Also, the |
@Aiee Thanks for the response. If this is expected then how we can improve our response time for 100vus as 300ms is too much. When you say overhead of locks is it about locks in session_pool.go at 120 Line. Thanks, |
I added a benchmark in the session pool test and here is the result I got.
Yes, I mean the locks being used when we move sessions from/to the list
|
Hide some interfaces Add space switch cases
Address comments
Why we need a session pool
The purpose of adding the
session pool
is to solve the problem caused by improperly using the connection pool. For example, a common case is that the user generates a new session, executes a query, and releases the session in a loop, like:This will cause huge traffic in the meta service and may crash the service.
Usage
See
session_pool_example.go
for a more detailed example.The usage of the connection pool remains unchanged.
Limitation
There are some limitations:
space
in the DB before initializing the session pool.sessinPool.execute()
is called, the session will execute the query in the space set in the session pool config.