Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
The task is to process a lot of commands that needs to be saved in some kind of stack or buffer.
While one method will push the data in, there will be multiple threads or processes, that will take thees tasks one by one and process them.
Right know the Idea is to save the tasks in buffer that uses NoSQL database, so we can get object and delete it simultaneously.
I'm thinking, that for this problem probably is already solution with some kind of server or library, that handles task processing and distribution between multiple instances.
Is there such a thing?
Well the pattern implementation depends on your specific needs. Your question is too general for a better answer than the one provide as a comment by #AljoshaBre: "this is a classic - producer/consumer problem. look it up on the webz.". If you look at the wikipedia article about producer/consumer problem, you can find the pattern implementation in Java - the general pattern is small, but to address your specific needs more details are required. You say something about "task processing and distribution between multiple instances", and it leads for a more specific architectural pattern called Distributed Message Queues (some random ref). There is the Apache project ActiveMQ that aims to implement such pattern.
I found gearman, php queue manager, and solution with nodejs node-amqp and php-amqp using RabbitMQ
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I need task/job queue gem that is similar to this android library, but for rails. I also don't mind writing the code myself/from scratch if there's no alternative.
These are the features I need:
I need the queue to be "app-wide", so that I can add tasks to it
from any controller.
I need to be able to set the maximum number of tasks the queue can process at a time.
I'd also like for it to allow me to set priority on tasks so that a more important one would be processed before a less important one.
What I'm trying to build uses twilio to send text messages to users. And Twilio has limits as to how many message one can send in a second. I need to be able to just call a method .send_message that automatically just adds the message to the queue and it waits it's turn.
I think Resque has most of the functionality you want.
You can set different priority, different queues and it is all backed by Redis so you entire application can share the queue.
you can use sidekiq it has many levels of support you can start with the free one before upgrading
Here is a video on how to set it up and use it as well
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Is there a good tutorial/guide/blog post/book chapter/screencast/etc that attempts to comprehensively cover everything having to do with locks, transactions, and isolation levels in ActiveRecord? (preferably relevant to Rails 4.0)
There's a brief section in the guides, and of course some API docs, but it's a really important and (for me) hard-to-understand domain, and it's my first time trying to take data integrity seriously in my Rails app. I'd like to get a good understanding so I can do it properly.
List of Known Resources
http://guides.rubyonrails.org/active_record_querying.html#locking-records-for-update
http://api.rubyonrails.org/classes/ActiveRecord/Locking/Optimistic.html
http://api.rubyonrails.org/classes/ActiveRecord/Locking/Pessimistic.html
http://api.rubyonrails.org/classes/ActiveRecord/Transactions.html
https://github.com/rails/rails/commit/392eeecc11a291e406db927a18b75f41b2658253 ("Support for specifying transaction isolation level" commit -> Rails 4.0)
http://railscasts.com/episodes/59-optimistic-locking-revised
I would check out Chapter 5 of The Rails 3 Way for now, particularly Section 5.5 on Database Locking. I would also look at the ActiveRecord::Locking source, ActiveRecord::Transactions source, and the transaction_isolation test case as the code is very readable and if you're going to need some down in the weeds answers, it's there in the code!
I found Differences between transactions and locking on Makandropedia a pretty useful starting point to learn the difference between transactions and locks.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
How can I test my Rails app with N concurrent users?
These simulated users will do some actions like upload/download files, etc.
Are there any frameworks or free tools that support this?
ab(Apache Benchmark) is made for that. Here is an example:
https://github.com/igrigorik/async-rails
I use jMeter, although the UI is a little rough IMO. I ended up sharing a lot of code between my easyb (Groovy-based) specs and a mini-DSL I used to create jMeter config/execution files (XML) so redundancy between specs and load testing was reduced. The same should be doable in Ruby as well.
JMeter allows concurrent testing, ramp-ups, all sorts of stuff. I don't know if it does everything a commercial tool does, but I've used it for a long time on a wide range if apps and it's been, more or less, satisfactory.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I am currently designing a low level network serialization protocol (in fact, a refinement of an existing protocol).
As the work progress, pen and paper documents start to show their limits: i have tons of papers, new and outdated merged together, etc... And i can't show anything to anyone since i describe the protocol using my own notation (a mix of flow chart & C structures).
I need a software that would help me to design a network protocol. I should be able to create structures, fields, their sizes, their layout, etc... and the software would generate some nice UMLish diagrams.
Sorry to say, everything I've seen so far (various serial protocols for embedded devices/networks) has used Word documents, with plain old tables showing allocations of fields to the bytes in the message. Alternatively, I've seen it done in Excel documents! It works, and people can read it.
Unfortunately, that's not helpful for automatic code generation, unless you have a very strict format in e.g. an Excel doc that you can then parse with a tool to generate some code. It would be good to have a notation that can be easily machine parsed, as well as human readable.
For showing message handshaking and sequences, a UML sequence diagram is good of course. There are lots of tools readily available to help you with that part of it.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
There has been some talk of Website performance monitoring tools and services on stackoverflow, however, they seem fairly expensive for what they actually do. Are there any good opensource libraries for automating checking/monitoring the availability of a website?
If you just want to know if your server is serving out content or not, take a look at Montastic. I use it, and am pleased. Plus its free!
It will ping your site periodically, and if it doesn't get a 200 status, it lets you know.
Intelligent website monitoring by simulating a human user is done with Sahi + OMD.
http://www.nagios-wiki.de/_media/workshop/2012/sahi2omd_simon_meggle_monitoring_workshop_2012.pdf
I have always used Zabbix especially for critical web sites. It uses MySql for the database and it has a PHP frontend. Of course it is open source and it is very flexible. It uses servers to stick data in the database and agents collect the data and send it to the servers. It is very scalable with this respect. I cannot recommend this software enough. I have all kinds of monitoring going on, not just web servers.
Check out mon.itor.us as well.