@bashy thanks for suggestion, I have tried it but it also fails.
@fideloper I'm using forge for adding queue workers, I think commands
php artisan queue:work {driver} --queue={queue} --delay=0 --memory=128 --sleep={sleep} --tries={tries} --env={environment}
and
php /home/forge/{website}/artisan queue:listen {driver} --timeout={timeout} --sleep={sleep} --quiet --tries={tries} --env={environment} --queue={queue}
are used.
I have been putting logs a lot so see where the stop showing and to determine the root of the problem (btw. I have noticed that the was an exception while I was testing and the was nothing in log file until I catched the exception and logged it myself, I didn't know that happens). I'm using phpoffice/phpexcel library for creating excel files and I have realised that job is failing when trying to save the .xlsx file to the server. So I wanted to know why so I was tracking and logging further and came to:
$this->_spreadSheet->garbageCollect():192; in Excel2007.php file, class PHPExcel_Writer_Excel2007.
After that I tried to do everything on the server where admin part of the system is and over there it exported users. That server has 1GB of RAM so it is a memory problem obviously, but it was weird to me why memory didn't went over 50% on the smaller server if thats the problem.
One more question, can I send mail attachment if I don't have it on se server as a file. I'm asking this because I don't really need to have that xlsx file on the server. Currently I'm sending mail in standard way like this
Mail::send('emails.export-users', $data, function($message) use($mails, $file){
$message->to($mails)->subject('User export')->attach($file);
});
so it would be cool if I could put an object(or something) in attach instead of file if something like that is possible.
One more time thank you for the effort @fideloper and @bashy