Some bug in Android client or web server

Hi,
I have some strange bug.
Server system: Seafile CE 6.0.7 with percona 5.7 mysql and memcached behind nginx+https on ubuntu 16.04.
Clients: Desktop - Ubuntu 16.04; Mobile - Android 6.0.

When photos are synced from desktop and files are viewed through the web, all images have thumbnails generated one by one. And all images I can preview on the browser.
When photos are synced from smartphone, image thumbnails are generated chaotically and after 1-2 seconds mysql server stops.
Logs does not show any useful information.

Have tried on another server - everything is fine.
Another server is installed without nginx and memcached.

Thumbnails shows fine in android and desktop clients.