I am moving a Magento 1.8.1.0 website on an Ubuntu 16.04 LTS server.
The same website is working fine on another machine running openSUSE 12.3.
The website seems to be correctly working on the new machine, however the frontend is incredibly slow (it takes 5 minutes to load every page, even the contacts page). The backend is pretty fast instead.
I tried clearing the cache, disabling it but nothing changes.
The profiler output shows me the following top results (ordered by time in excel)
Do you have any suggestion on what is possibly going wrong?