HTTP 500 server internal error

Hi, I'm customizing a dashlet, but when I try to receive data from SugarCRM on demand using filter API. But, when setting max num filter to -1 (no data limit), I get 500 (Internal Server Error).

I'm trying to bring over 8600 records. If I put 8000 instead of -1 right there, I can bring the records and recieve 200. But, I can't have this kind of limit on my request because my aplication needs this records.

What should I do?