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

Locking contention between Chapel and libpq #23

Open
buddha314 opened this issue Apr 25, 2018 · 6 comments
Open

Locking contention between Chapel and libpq #23

buddha314 opened this issue Apr 25, 2018 · 6 comments
Labels

Comments

@buddha314
Copy link
Collaborator

@Tshimanga has been working on a locking contention issue, where the threading used in libpq conflicts with Chapel's native threading methods. Or at least it appears to.

@buddha314
Copy link
Collaborator Author

OH MY GOD! I spelled Kerim's name correctly without looking!

@marcoscleison
Copy link
Collaborator

I know that CDO cursors need to be improved having performance in mind. But I really want to understand this lock issue. If it is in CDO, it will easy to solve, but if it is related to libpq we need an approach to solve it.

@buddha314
Copy link
Collaborator Author

This is tied to #22 Here is an example of a PG library based on non-blocking sockets: https://github.com/leafo/pgmoon/tree/master/pgmoon

@ben-albrecht One of our engineers suggested this would be much easier of Chapel had non-blocking sockets. Any opinion on that?

@ronawho
Copy link

ronawho commented Apr 25, 2018

Shot in the dark (I don't know anything about libpq or what you're trying to do in general) -- if the general problem is that threads created in an external library seem to be contending with Chapel threads/tasks one thing you could try is export QT_AFFINITY=no and if that doesn't help maybe also set QT_SPINCOUNT=300

qthreads (our default tasking layer) likes to assume it owns the entire machine, so it will do things like pin worker pthreads to cores, and spinwait while waiting for more tasks. We have seen cases (usually with Chapel+OpenMP interop) where that ends up just creating a lot of contention and slows things down, so disable affinity/pinning and lowering the amount of spinwaiting may help.

@ben-albrecht
Copy link
Collaborator

One of our engineers suggested this would be much easier of Chapel had non-blocking sockets.

I'll defer this one to @mppf, though he may have already addressed this in Gitter discussion.

@mppf
Copy link

mppf commented Apr 30, 2018

Chapel doesn't have a Chapelriffic sockets library at all right now. It does provide thin wrappers around the C sockets functions. These can already be used to create nonblocking sockets. Of course, it would be great if these were accessible in a more Chapel friendly way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants