I run 10 unicorn workers for each server and they all eat mySQL connections over time, "lots of connection error. It starts with 10 connections, but gradually increases to 20.
When I run the following script (using the show processlist ), I can see that each IP (= app server) has 20 connections each where it Should be 10 - the number of excitly unicorn workers is doubled. Result = ActiveRecord :: base.connection.execute 'Show Prostallists' result.group_by {| I I [2] .split (':'). First} .map {| Kashmir, V. [K, v.size]} = & gt; [["192.168.1.2", 20], ["192.168.1.3", 20], ["192.168.1.4", 20], ...] The database here is Yml
Production: Adapter: mysql2 ... pool: 1 Here's the netstate:
# netstat - a | Grep: 3306 TCP 0 9 20.168.1.2: 18585 192.168.1.123:3306 Installed TCP 0 192.168.1.2:45021 192.168.1.123:3306 Installed TCP 0 9 20.168.1.2: 518537 192.168.1.123:3306 Installed TCP 0 0 192.168 1.2: 45119192.168.1.123:3306 TIME_WAIT ... #netstate -n | Grep: 3306. WC-L 36 # NetState -n | Grep: 3306. Grep ESTABLISHED | Wc -l 33 I am worried that there is only a few TIME_WAIT - it should not be that the connection should be all stable - it seems that the worker needs Get more connections than many free RAM, no swap / OOM Ruby 2.0.0p0 / Rail 3.2.13
What is the reason?
Well, thanks for the advice, I found out that the agent has made his connection to his code in
NewRelic :: Agent :: Database :: ConnectionManager #. Get_connection .
This code call ActiveRecord :: Base.mysql2_connection , which in turn calls Mysql2 :: Client.new , Which does not respect connection pool settings. This only happens when there is a slow transaction (Ironically, this code overloads more databases), so it has been edited newrelic.yml transaction_tracer: explain_enabled: false and the problem is resolved! Until the new residue resolves this problem, I keep it in the same way.
Popular posts from this blog
After opening several examples of macro / code written, I suddenly get stuck with a code that seems safe. Solver (SOLVER.XLAM) is doing this notation and I would like to remove it from my system. I do not think this is a relativant code. Can anyone tell me what should I do? I have already installed something to remove the password but Solver is still asking for password and I can not get rid of it! itemprop = "text"> Solver Excel is add-in If you want to delete it, then Excel Application & gt; Options & gt; Add-ins & gt; Search for 'Go to' button and gt; Uncheck the solver on the list like press something (I can not give you the exact path because I have the Polish version of Excel). Trying to open Solver's VBA code is not good because it There is allegedly copyright. Besides, I do not think Solver creates any disadvantages while working with Excel or VBA.
I have a team city build project with Gitbab VCS route, I have been triggered for both / head on PR and / Merge the referee. The annoying thing is that you can not do anything useful with the merged hash - it is not present in Gitobb. I want to exclude newsgate packages with head in gutub comet situations in the version number along with Hewash (Newsaging 7) for the music build, but against head hash. However, I can not see a way to get the head hashes while constructing that merge. I just want to head because it's useless - we only care about merge. (PR - Pull Request) This command works reliably while running One on / merge is git log --no-merge -1 ---- = '% h'
I have a UITextView and I change a word like the code at the end of UITextView.text: - (void) Replace TexttechWitWord: (NSString *) word {NSString * currentTextViewText = self.textView.text; CurrentTextViewText = [currentTextViewText stringByReplacingCharactersInRange: NSMakeRange ([self.textView.text length] - [word length], [word length]) withString: word; Self.textView.text = currentTextViewText; } Replacement work is fine, but it runs very slowly and very slowly when the textView now lengthens Is there any better way? I try the replacement range: with text for a week but still stuck. Not to know how to use it to replace it in your case. Please guide! Thanks in advance! This is an important job. As you are using an irreversible string and you are creating a very long string and before Assigned to NSString created from. NSString will be used instead of NSMutableString . - (UITableViewCell *) TableView: (UITableView *) Table View CellForOutPath: (NSIndex...
Comments
Post a Comment