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
I have some values in my database in the column, as I have been shown in the picture below, Now if you notice there over there In the position of number three, we have the value, which is Italian, pizzeria (pizza), there may be some other values that can be included in the Italian, pizzeria (pizza) like COMMA (,) Yes, as we can see in the picture below, Now I want to get all the values of php (select * from tablename), but if the value is included in COMMA, then I Any way to filter out? I just want to select values that do not have any commas, thanks in advance? Unless there is a pregate in my knowledge, or an array filter can help. would not like predicate: Choose * Where 'Business' food is not like '%,%' from the tablet name;
I am trying to store the image in a stapple panel .. \ resources \ ebi.png Most of the time, the textbox input Based on "Atracount", the same image will be displayed in the StackPanel below, the sample code has been attempted, but it is getting an error saying "The specified view is already visible to any other view Has a child or is the origin of a composition goal " is the code below The Oshis: private bitmap image bmp = new Bitmap image (new Uri ( "WpfApplication1; components / resources / ebi.png", Urikind. Riletiv Orsolut)); Private Zero EtReqCount_TextChanged (Object Sender, TextChangedEventArgs E) {StackPanel dynamicStackPanel = new StackPanel (); DynamicStackPanel.Width = 300; DynamicStackPanel.Height = 200; DynamicStackPanel.Background = New SolidColorBrush (Color. LightBu); DynamicStackPanel.Orientation = Orientation. Vertical; If (Attarcount.Text! = "") {For (int k = 1; k & lt; = int32.Parse (etReqCount.Text); k ++) {I...
I am a rookie in Android programming I have a little problem when I have a visual image , I make that image invisible and set one button in visible. My problem is how can you save it? For example, I click on ImageView, the button shows and ImageView disappears. And I get out of the app and come back in the same activity and I want the button to be there. How do I do this? import android.app.activity; Import android.content.Intent; Importroid.os.Bundle; Import android.view.View; Import android.view.Window; Import android.view Windows Manager; Import android.widget.Button; Import android.widget.ImageView; Public class Udhanplan activity (button A, B ImageView; private boolean qualified; public Crete to zero (the bundle saved Instansstet) saved {Suprknkret (Instensstet); requestWindowFeature (Window.FEATURE_NO_TITLE); GetWindow (). Setflag ( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView (R.layout.flightplan); B = (Imag...
Comments
Post a Comment