From owner-freebsd-ports@freebsd.org Thu Feb 22 09:12:26 2018 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59757F17045 for ; Thu, 22 Feb 2018 09:12:26 +0000 (UTC) (envelope-from karli@inparadise.se) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id C47C276E03 for ; Thu, 22 Feb 2018 09:12:25 +0000 (UTC) (envelope-from karli@inparadise.se) Received: by mailman.ysv.freebsd.org (Postfix) id 811DBF17043; Thu, 22 Feb 2018 09:12:25 +0000 (UTC) Delivered-To: ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D1B4F1703E; Thu, 22 Feb 2018 09:12:25 +0000 (UTC) (envelope-from karli@inparadise.se) Received: from mail.inparadise.se (h-246-50.A444.priv.bahnhof.se [155.4.246.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D771176DFE; Thu, 22 Feb 2018 09:12:24 +0000 (UTC) (envelope-from karli@inparadise.se) Received: from localhost (localhost [127.0.0.1]) by mail.inparadise.se (Postfix) with ESMTP id 1F94A42B5B; Thu, 22 Feb 2018 10:12:23 +0100 (CET) Received: from mail.inparadise.se ([127.0.0.1]) by localhost (mail.inparadise.se [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id B2GF5-Y2J7P8; Thu, 22 Feb 2018 10:12:21 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.inparadise.se (Postfix) with ESMTP id AA26D42B62; Thu, 22 Feb 2018 10:12:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.inparadise.se AA26D42B62 X-Virus-Scanned: amavisd-new at inparadise.se Received: from mail.inparadise.se ([127.0.0.1]) by localhost (mail.inparadise.se [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id YfIcV0JMt5kj; Thu, 22 Feb 2018 10:12:21 +0100 (CET) Received: from its-5cg60227mj (its-5cg60227mj.its.uu.se [130.238.131.18]) by mail.inparadise.se (Postfix) with ESMTPSA id 85BF042B5B; Thu, 22 Feb 2018 10:12:21 +0100 (CET) Message-ID: <1519290717.1980.31.camel@inparadise.se> Subject: Re: monitoring ruby app memory usage with passenger-recycler (was: Cannot require library for passenger in ruby) From: Karli =?ISO-8859-1?Q?Sj=F6berg?= Reply-To: karli@inparadise.se To: Marcin Cieslak Cc: ports@freebsd.org, ruby@freebsd.org Date: Thu, 22 Feb 2018 10:11:57 +0100 In-Reply-To: <1519282237.1980.26.camel@inparadise.se> References: <1519282237.1980.26.camel@inparadise.se> Organization: InParadise Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-8Piy0fRJHq0TcXJJQqtn" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Feb 2018 09:12:26 -0000 --=-8Piy0fRJHq0TcXJJQqtn Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2018-02-22 at 07:50 +0100, Karli Sj=C3=B6berg via freebsd-ports wrote: > On Tue, 2018-02-20 at 21:31 +0000, Marcin Cieslak wrote: > > On Mon, 19 Feb 2018, Karli Sj=C3=B6berg wrote: > >=20 > > > > What is the tool you are trying to deploy? foreman_maintain? > >=20 > > Sorry, I was too quick. This foreman_main is used to > > download/update > > foreman > > from RedHat Satellite servers, which is not what you want. >=20 > Well, I want the "foreman_maintain" package, which includes > "passenger- > recycler", so I guess I do want it :) >=20 > >=20 > > However, the passenger-recycler script is a standalone script which > > could possibly used with this little fix: >=20 > Ooh, awesome! Yeah, should=C2=B4ve figured since it=C2=B4s only at 0.1.3 = :) >=20 > >=20 > > https://github.com/theforeman/foreman_maintain/pull/143 > >=20 > > To apply this, please add files/patch-bin_passenger-recycler in the > > port I've sent before: > >=20 > > --- bin/passenger-recycler.orig 2018-02-20 21:09:18 UTC > > +++ bin/passenger-recycler > > @@ -41,10 +41,10 @@ def process_status?(pid) > > end > > =20 > > require 'phusion_passenger' > > +PhusionPassenger.locate_directories > > require 'phusion_passenger/platform_info' > > require 'phusion_passenger/platform_info/ruby' > > require 'phusion_passenger/admin_tools/memory_stats' > > -PhusionPassenger.locate_directories > > stats =3D PhusionPassenger::AdminTools::MemoryStats.new > > unless stats.platform_provides_private_dirty_rss_information? > > puts 'Please run as root or platform unsupported' >=20 > Yes, this works, thanks! >=20 > >=20 > >=20 > > But the real problem is that Passenger does think it supports > > getting process private dirty RSS memory information only on Linux: > >=20 > > https://github.com/phusion/passenger/blob/219ad24159ae4033a342e6ad7 > > 53 > > cfee05d98bae0/src/ruby_supportlib/phusion_passenger/admin_tools/mem > > or > > y_stats.rb#L121 > >=20 > > In file > > src/ruby_supportlib/phusion_passenger/admin_tools/memory_stats.rb: > >=20 > > 120 def platform_provides_private_dirty_rss_information? > > 121 return os_name_simple =3D=3D "linux" > > 122 end > >=20 > > This support probably would need to be written. So, unfortunately, > > passenger-recycler > > as written will exit with: > >=20 > > Please run as root or platform unsupported >=20 > Yes, I have now gotten to this stage at least, thank you very much! I > don=C2=B4t mind having a look at it, it might be simplest thing to write, > or > it=C2=B4s hell, but I=C2=B4ll have a look! >=20 > Thank you for pointing me in the right direction! >=20 > /K >=20 > >=20 > > But passenger-recycler does something very simple - if the amount > > of > > "private resident RSS > > memory" is higher than specified amount in the configuration file, > > it > > kills the process. > >=20 > > You might get a much better monitoring on FreeBSD by monitoring the > > output of > >=20 > > procstat -v > >=20 > > which will give you details about the memory usage of the process > > and > > see how it is growing > > over time. Maybe you can pinpoint the shared library that causes > > this, if you are lucky. How do I interpret the output of 'procstat -v ' though? Can I sum up all of the RES or PRES numbers to get the total virtual memory that this process is consuming? /K > >=20 > > Marcin --=-8Piy0fRJHq0TcXJJQqtn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEcBAABCAAGBQJajoldAAoJEBpo164N2cuRYy0H/2f/9+wUPshB67rRNyGd1uV8 tEsK02AVouTlPwMteLubkqBB0FraXatdF+8LETSkJ2SJ/cM3RS2UcOlRL9Tuzmof jexaWj/XP/RC24Vx3EM1ZhtsXcx35rXcP9KrcO4s+GZ2k0U/D1id6jNwl7MZgm3r MIoxHjOTvDN1Q1ejDtiVRtP7eV1GrRcHnc4fOTedF03tMUO5jxPnUIvwID/ZwHk+ 8KGcqrcf6BY5Jx18INEDlPkyo0MLrIedzAYmfI8MvRQ3F2fqVcMQeOtwYCTzEqEJ 5DmrkNHzpEafRUNbbKaT+b2j6CVmoWNjHbMWExQ26Vmzct98cjRqO0zRq2aM4D0= =2PTA -----END PGP SIGNATURE----- --=-8Piy0fRJHq0TcXJJQqtn--