diff --git a/lib/image_inference_impl.h b/lib/image_inference_impl.h index 055060c..11937d1 100644 --- a/lib/image_inference_impl.h +++ b/lib/image_inference_impl.h @@ -252,7 +252,7 @@ class image_inference_impl : public image_inference, base_impl { boost::scoped_ptr inference_thread_; boost::scoped_ptr torchserve_client_; boost::lockfree::spsc_queue inference_q_{MAX_INFERENCE}; - boost::lockfree::spsc_queue json_q_{MAX_INFERENCE}; + boost::lockfree::spsc_queue json_q_{MAX_INFERENCE * 2}; boost::scoped_ptr cmapped_buffer_, resized_buffer_, normalized_buffer_; diff --git a/lib/iq_inference_impl.cc b/lib/iq_inference_impl.cc index 62cb072..50b7a74 100644 --- a/lib/iq_inference_impl.cc +++ b/lib/iq_inference_impl.cc @@ -417,6 +417,7 @@ void iq_inference_impl::process_items_(COUNT_T power_in_count, if (background_) { if (!inference_q_.push(output_item)) { delete_output_item_(output_item); + --serial_; if (host_now_() - last_full_time_ > 5) { d_logger->error( "inference queue full (increase inference dB threshold " diff --git a/lib/iq_inference_impl.h b/lib/iq_inference_impl.h index 56d76ce..c18c00c 100644 --- a/lib/iq_inference_impl.h +++ b/lib/iq_inference_impl.h @@ -253,7 +253,7 @@ class iq_inference_impl : public iq_inference, base_impl { boost::lockfree::capacity> inference_q_; boost::lockfree::queue> + boost::lockfree::capacity> json_q_; boost::shared_ptr io_service_; boost::shared_ptr work_;