Andy Simon
Andy Simon

Reputation: 53

after use gem axlsx_rails, I get error "Memory quota exceeded"

I use gem axlsx_rails for create report based on html table in view. After use this gem, I get an error on Heroku R14 Memory quota exceeded. But this message I receive even when there are few people on the site (at night). When I restart dyno, the message is deleted temporarily and after some time it repeats. it seems to me that somewhere there is a memory leak, memory is used, but not cleaned. could you please help me understand what the problem is? any idea?

P.S.

Dyno - Performance-M(RAM 2.5GB). Autoscaling up to 2. Memory use up to 6GB

Web-server - Puma

WEB_CONCURRENCY - 2

RAILS_MAX_THREADS - 5

now I changed WEB_CONCURRENCY to 1 and restarted the server, there are no problems yet, but something tells me that this is for the time being. Previously, this was not.

Upvotes: 2

Views: 241

Answers (1)

Franti
Franti

Reputation: 21

Indeed, axlsx(or caxlsx) is not known for its performance. Saddly, I have not found any solution to make it work with axlsx... but, you may try fast_excel

Here is some benchmarks figures for 100k records:

Memory benchmark — — — — — — — — — — — — — — — — — — -
     fast_excel:  55201256 allocated
     xlsxtream:  311132199 allocated —  5.64x more
     caxlsx:     1941847581 allocated — 35.18x more


Time benchmark — — — — — — — — — — — — — — — — — — -
     fast_excel:  5.2363 seconds
     xlsxtream:   7.9638 seconds -  1.52x more
     caxlsx:      77.9891 seconds - 14.89x more

Upvotes: 1

Related Questions