Category Archives: asp.net-mvc-3

How to close inactive connections in Postgres

Postgres 9.1 sever is running under Debian. It is accessed by Mono MVC4 web applications using ngpsql, Apache and mod_mono. It is also accessed by pg_dump in same computer every night and from 5432 port from internet. Connections were cleared at June 20. pgAdmin statuc window shows lot of idle connections starting from this day. (see image below).

After some time number of connections goes to 100 and server stops to accept connections. Connections needs to be manually killed in pgAdmin. Only after that server start accepting connections again.

It is interesting that start times of some of those connections are exactly the same as shown in image. How to fix or diagnose the issue ? I tried /etc/init.d/apache2 restart . This closed 25 and 27 June connections but 20 June connections are still open.

How to close idle connections automatically or find the reason of open connections ? Maybe there is some postgres or Debian setting which closes idle connections automatically ?

open Using

"PostgreSQL 9.1.2 on x86_64-unknown-linux-gnu, compiled by gcc-4.4.real (Debian 4.4.5-8) 4.4.5, 64-bit"

Mono – mod_mono consuming 100% of CPU

I'm running ASP.NET MVC 3 site on Mono 3.2.8 (Ubuntu 14.04 + Apache2.4.7 + mod_mono). I've noticed that there are two processes eating up all CPU. Running htop:

enter image description here

I also constantly get this entry in my log:

WARNING: WebConfigurationManager's LRUcache evictions count reached its max size
Cache Size: 100 (overridable via MONO_ASPNET_WEBCONFIG_CACHESIZE)
------------
[Fri Jun 05 06:49:53.446031 2015] [mpm_prefork:notice] [pid 21501] AH00171: Graceful restart requested, doing restart
mod-mono-server received a shutdown message
mod-mono-server received a shutdown message
mod-mono-server received a shutdown message
mod-mono-server received a shutdown message
mod-mono-server received a shutdown message

Any idea what could be causing it?