Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8569743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:24:26+00:00 2026-06-11T18:24:26+00:00

I have a Clojure network application, basic structure is like this: Server has one

  • 0

I have a Clojure network application, basic structure is like this:

  • Server has one LinkedBlockingQueue or ArrayBlockingQueue (I have tried both)
  • Multiple threads accept network connections, and offer work to the queue
  • One thread take from the queue in an infinite loop and work on each item taken

And I have noticed severe performance issue with take call:

  • Threads are offering to the queue at a very fast rate, and the queue takes them all very quickly
  • The one worker thread take from the queue at a very very slow rate (more than 200 times slower than the speed of offer)
  • CPU usage is very very low – so the worker is not busy at all

Without using the queue, in a benchmark situation, the same workload is able to be maximize CPU usage and be done at a satisfactory speed.

So what is the best queuing technique to use in this scenario?

Here’s my code (less than 100 lines);

https://github.com/HouzuoGuo/Aurinko/blob/master/src/Aurinko/core.clj

Edit, details of my observation:

  • I benchmarked request processing speed, it works at approximately 8,000 requests per second without using a queue.
  • I made the server program to print a debug message when it queues a request, and another message when it finishes processing a request.
  • I made a simple client program to send approximately 1,000 requests per second to the server.
  • The server queues all the requests in time, and the queue becomes many thousands of elements long.
  • Worker (request processor) appears to be working at only about 150 requests per second, according to the debug messages.

Edit:

Thanks for everyone’s help. I have confirmed that blocking queue is not the thing causing the performance issue. Although I have not found the performance bottleneck in my application, but there has to be one somewhere.

Final edit:

Thank you everyone. The performance bottleneck was caused by network IO rather than the blocking queue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:24:28+00:00Added an answer on June 11, 2026 at 6:24 pm

    You state: “CPU usage is very very low – so the worker is not busy at all”. You also say: “I have confirmed that blocking queue is not the thing causing the performance issue. Although I have not found the performance bottleneck in my application, but there has to be one somewhere.”

    If both of those statements are true, it might be that your worker thread spends a lot of time waiting on I/O. If so, there is a simple solution: run more than one worker thread!

    Or it may be that there is some other concurrency bottleneck (not the work queue).

    Why don’t you do the following: make a little test program which pushes about 1,000 items on the work queue, and then starts running the same code which runs on the worker thread. When the queue is empty, it should exit. Profile that program. (Do you have a profiler set up on your dev machine? I like using JIP.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In clojure I have lines like this that define default values: (def *http-port* 8080)
I'm learning clojure and have a very basic question: given that clojure has type
Does clojure have a powerful 'loop' like common lisp. for example: get two elements
I have a clojure/ring project that has two distinct app/handlers running on different ports
I tried the following in Clojure, expecting to have the class of a non-lazy
What I would like to do (in Clojure): For example, I have a vector
I have Clojure function that returns a LazySeq. When I run this function from
I have a Clojure data structure of the form: {:foo '(bar blat)} and have
In Clojure, I have a collection coll of 2-elements vectors. I would like to
I have a need to serialize a Clojure data structure to XML, but I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.