Server is slow or unresponsive (internal server error)

Subscribe to Server is slow or unresponsive (internal server error) 6 post(s), 2 voice(s)

 
Avatar Harianto 4 post(s)

Hi Brightbox,

Our websites that are builed on Rails (Passenger) and using Shared Database shows Internal Server Error.
Rebooting the Apache webserver, the rails applications runs smoothy again.
After a while it shows the same errors again:
‘PhusionPassenger::Railz::ApplicationSpawner::Error’

Well I thought updating the passenger and the server would fix the problem. So it did.. well .. not for long. It shows the same error again.

Another similiar problem
I’m using PHP cms connected to the Shared Database. When I was editing the pages, sometimes the responsive time was realy slow. And I even get the ‘500 Internal Server Error’.

So I was wondering if the Shared Database is that cause the problem. I’ve read the news there was a maintenance going on 2nd of June 2009. I wonder if that’s still the case.

That’s not the only problem, our whole server seems to be unresponsive. Even our simplest website without database, doesn’t show at all.

How can I fix this? Or is there another sulution for this?

Thanks in advance

Harianto
SYLO

 
Avatar John Leach Administator 83 post(s)

Hi Harianto,

can you paste any relevant look messages from /var/log/apache/error.log ?

Thanks,

John.

 
Avatar John Leach Administator 83 post(s)

also the output from:

sudo grep "Out of memory" /var/log/kern.log

Thanks,

John.

 
Avatar Harianto 4 post(s)

there’s semething about the “swap”. it’s ZERO?
-
Jun 29 16:39:07 syloror-001 kernel: [1128566.595800] Call Trace:
Jun 29 16:39:07 syloror-001 kernel: [1128566.595812] [] oom_kill_process+0xf6/0×110
Jun 29 16:39:07 syloror-001 kernel: [1128566.595815] [] out_of_memory+0x19e/0×1e0
Jun 29 16:39:07 syloror-001 kernel: [1128566.595818] [] __alloc_pages+0x389/0×3c0
Jun 29 16:39:07 syloror-001 kernel: [1128566.595822] [] __do_page_cache_readahead+0x104/0×260
Jun 29 16:39:07 syloror-001 kernel: [1128566.595825] [] filemap_fault+0x2de/0×3e0
Jun 29 16:39:07 syloror-001 kernel: [1128566.595829] [] __do_fault+0x6a/0×5d0
Jun 29 16:39:07 syloror-001 kernel: [1128566.595831] [] handle_mm_fault+0x1d1/0xd60
Jun 29 16:39:07 syloror-001 kernel: [1128566.595836] [] do_page_fault+0x1f3/0×11e0
Jun 29 16:39:07 syloror-001 kernel: [1128566.595840] [] _atomic_dec_and_lock+0x48/0×70
Jun 29 16:39:07 syloror-001 kernel: [1128566.595844] [] mntput_no_expire+0x27/0xb0
Jun 29 16:39:07 syloror-001 kernel: [1128566.595846] [] remove_vma+0x4c/0×60
Jun 29 16:39:07 syloror-001 kernel: [1128566.595848] [] do_munmap+0x291/0×2f0
Jun 29 16:39:07 syloror-001 kernel: [1128566.595851] [] __up_write+0x22/0×130
Jun 29 16:39:07 syloror-001 kernel: [1128566.595854] [] error_exit+0x0/0×79
Jun 29 16:39:07 syloror-001 kernel: [1128566.595858] [] ia32_syscall+0x0/0×49
Jun 29 16:39:07 syloror-001 kernel: [1128566.595860]
Jun 29 16:39:07 syloror-001 kernel: [1128566.595861] Mem-info:
Jun 29 16:39:07 syloror-001 kernel: [1128566.595863] DMA per-cpu:
Jun 29 16:39:07 syloror-001 kernel: [1128566.595865] CPU 0: Hot: hi: 0, btch: 1 usd: 0 Cold: hi: 0, btch: 1 usd: 0
Jun 29 16:39:07 syloror-001 kernel: [1128566.595866] DMA32 per-cpu:
Jun 29 16:39:07 syloror-001 kernel: [1128566.595868] CPU 0: Hot: hi: 90, btch: 15 usd: 82 Cold: hi: 30, btch: 7 usd: 23
Jun 29 16:39:07 syloror-001 kernel: [1128566.595871] Active:57234 inactive:174 dirty:0 writeback:0 unstable:0
Jun 29 16:39:07 syloror-001 kernel: [1128566.595872] free:794 slab:2566 mapped:9 pagetables:487 bounce:0
Jun 29 16:39:07 syloror-001 kernel: [1128566.595874] DMA free:1096kB min:124kB low:152kB high:184kB active:9980kB inactive:0kB present:16160kB pages_scanned:16858 all_unreclaimable? yes
Jun 29 16:39:07 syloror-001 kernel: [1128566.595876] lowmem_reserve[]: 0 244 244 244
Jun 29 16:39:07 syloror-001 kernel: [1128566.595879] DMA32 free:2080kB min:1936kB low:2420kB high:2904kB active:218956kB inactive:696kB present:250480kB pages_scanned:334654 all_unreclaimable? yes
Jun 29 16:39:07 syloror-001 kernel: [1128566.595881] lowmem_reserve[]: 0 0 0 0
Jun 29 16:39:07 syloror-001 kernel: [1128566.595883] DMA: 2*4kB 0*8kB 0*16kB 0*32kB 1*64kB 0*128kB 0*256kB 0*512kB 1*1024kB 0*2048kB 0*4096kB = 1096kB
Jun 29 16:39:07 syloror-001 kernel: [1128566.595887] DMA32: 57*4kB 0*8kB 2*16kB 3*32kB 1*64kB 3*128kB 1*256kB 0*512kB 1*1024kB 0*2048kB 0*4096kB = 2084kB
Jun 29 16:39:07 syloror-001 kernel: [1128566.595892] Swap cache: add 0, delete 0, find 0/0, race 0+0
Jun 29 16:39:07 syloror-001 kernel: [1128566.595893] Free swap = 0kB
Jun 29 16:39:07 syloror-001 kernel: [1128566.595894] Total swap = 0kB
Jun 29 16:39:07 syloror-001 kernel: [1128566.595895] Free swap: 0kB
Jun 29 16:39:07 syloror-001 kernel: [1128566.596793] 67584 pages of RAM
Jun 29 16:39:07 syloror-001 kernel: [1128566.596795] 2602 reserved pages
Jun 29 16:39:07 syloror-001 kernel: [1128566.596796] 14322 pages shared
Jun 29 16:39:07 syloror-001 kernel: [1128566.596796] 0 pages swap cached
Jun 29 16:39:07 syloror-001 kernel: [1128566.596798] Out of memory: kill process 19597 (ruby1.8) score 13350 or a child
Jun 29 16:39:07 syloror-001 kernel: [1128566.596810] Killed process 19597 (ruby1.8)
-

Do I need to free space? Actually i don’t understand what it realy says.

 
Avatar Harianto 4 post(s)

And I’m also wondering if it’s too much running 8 Rails websites with Passenger on a Brightbox 256?

 
Avatar John Leach Administator 83 post(s)

For most common Rails deployments, swap space just delays the inevitable ram exhaustion, and in the process slows down your box massively and puts very heavy load on our SANs. So it is disabled by default. We recommend that you plan your deployments so that you don’t overcommit your ram.

I think 8 Rails web apps on a 256 box is stretching it too far. Even if your apps were very very small (let’s say 35mb), and you limited them to 1 instance per app, that would still be 280mb RAM, even before Apache, ssh etc. Even with the highest Passenger spawner settings, I doubt you’d get 8 apps running on there. And you only get 5 MySQL connections with a 256 box too, so only 5 instances could use the MySQL server at a time (assuming they need it).

I’d recommend you estimate how much ram each app usually uses after it’s been running a while, and then upgrade your Brightbox accordingly. To ensure the least ram usage, set PassengerMaxInstancesPerApp to 1 and PassengerMaxPoolSize to the number of apps you need to have running. Also, try setting RailsSpawnMethod to smart (though this can break some apps, so test thoroughly).

More documentation on these settings here:

http://www.modrails.com/documentation/Users%20g…

Signup or login to contribute