queue

How to throttle script that creates celery tasks faster than they're consumed?

喜欢而已 提交于 2019-12-22 09:41:15
问题 I have a script that generates millions of Celery tasks, one per row in the DB. Is there a way to throttle it so that it doesn't completely flood Celery? Ideally I want to keep Celery busy, but I don't want the length of the Celery queue to exceed a few dozen tasks since that's just a waste of memory (especially since without some kind of throttle the script will add millions of tasks to the queue almost instantly). 回答1: I've spent some time on this problem over the past several days and came

MySql - Is there a queries queue somewhare

余生颓废 提交于 2019-12-22 08:31:23
问题 I used a loop in my php script to run insert queries into my db. The loop was looping thousand times. I stop my php script while it was till running. Nevertheless, my db table keeps on getting populated continously. I guess that there must be a queue. but this is only a guess. So I am wondering if I can stop all the pending queries from being executed? Also I am wondering if it is possible to see that queue somewhere? Thank you in advance for your replies. Cheers. Marc. 回答1: There is no queue

JOB_TOO_BIG Pheanstalk - what can be done?

帅比萌擦擦* 提交于 2019-12-22 05:13:35
问题 On Laravel 4.2 & Laravel Forge I Made a mistake and accidentally pushed some code on to the production sever, but there was a bug and it pushed a job to the queue without deleting it once done. Now I can't push anything in the queue anymore, I get: Pheanstalk_Exception JOB_TOO_BIG: job data exceeds server-enforced limit What can I do? 回答1: This is because you're trying to store too much data in the queue itself. Try to cut down the data you're pushing to the queue. For example if your queue

Queue implementation in C#

蓝咒 提交于 2019-12-22 05:02:07
问题 I'm dealing with a hardware resource that can only handle 1 command at a time. I'm going to exposing some of it's API functions via a web interface, so obviously there's a good chance more than 1 command will get sent at a time. I have decided that queuing these commands when they're submitted is the best way to ensure serial processing. I'm planning on implementing the queue in a static class. The web app code-behind will add a command by calling a method corresponding to the command they

Queue implementation in C#

自古美人都是妖i 提交于 2019-12-22 05:02:04
问题 I'm dealing with a hardware resource that can only handle 1 command at a time. I'm going to exposing some of it's API functions via a web interface, so obviously there's a good chance more than 1 command will get sent at a time. I have decided that queuing these commands when they're submitted is the best way to ensure serial processing. I'm planning on implementing the queue in a static class. The web app code-behind will add a command by calling a method corresponding to the command they

Apache webserver - What happens to requests, when all worker threads are busy

房东的猫 提交于 2019-12-22 04:03:32
问题 As far as I researched, the scenario when all worker threads are busy serving requests, what happens to the requests that comes next. Do they wait? Is this related to some configurable parameters? Can I get the count of such requests ? Adding to this please can you explain or give a link where I can get a clear picture of request processing strategy of Apache webserver? Thanks for Looking at!! 回答1: Additional to the post from cbroughton: You should have a maximum of 500 request (this strongly

MySQL table as a FIFO/Queue

两盒软妹~` 提交于 2019-12-21 22:07:45
问题 How can we treat a Mysql table as a limited FIFO buffer (Queue). Objectives are : The table at a time can have only N number of rows. When a row is inserted, the oldest row shpuld be deleted to maintain the row count as N. Pls suggest approaches. UPDATE: Sorry guys, as many pointed I changed my question from STACK to FIFO queue 回答1: Past Mysql 5 you could use a trigger to achieve this. http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html then your triggered sql would be along the lines

Using Interfaces to Create a Queue for Arbitrary Types

故事扮演 提交于 2019-12-21 22:03:21
问题 As an exercise for learning Go I am writing a basic Queue data structure. I started learning about interfaces yesterday I thought it would be cool to try and use them for this exercise. What I am trying to accomplish is to have a Queue that can accept any type that implements this interface: type Queuable interface { Next() *Queuable // This is probably not right } Basically what I want is to be able to add any type that has a Next() method to my Queue . So what I tried was: type Node struct

Java single worker thread for SQL update statements

我是研究僧i 提交于 2019-12-21 21:36:37
问题 I'm working on a Java-based server in which I will have multiple threads (one thread for each connected user + some extra). There will be some database connection involved, so I was thinking that each time the server makes a SELECT query to the database it will start a new thread for this, to prevent blocking from the current thread. I'm planning on using a connection pool for this and I think I know how to do that. (I've looked into C3P0) However, there will be a lot of UPDATE statements

synchronization across multiple processes in python

帅比萌擦擦* 提交于 2019-12-21 19:57:39
问题 I have a python application that spawns a separate process to do some work (I ran into performance issues using threads due to the GIL (global interpreter lock)). Now what's my methods in python to synchronize shared resources across processes? I move data into a queue and a spawn process does the work when as it receives data from that queue. But I need to be able to guarantee that the data is coming out in an orderly fashion, same order as it was copied in so I need to guarantee that only