Issue about log analysis for load balancing servers

I’m using Piwik for analyzing logs from load balancing servers.
When I import the data from the logs with different timestamp, it shows some errors, after investigation, I’ve found out that the reasons as below:

LogServer1 – Visitor 1: 10:00:00
LogServer1 – Visitor 1: 11:30:00
LogServer2 – Visitor 1: 10:20:00 - Error

If any time earlier than the time of imported data , the import job will fail (Actually fail the SQL execution).

Is that possible to import the data successfully with random timestamps?

See the ticket below:

I tried to merge the logs and sort the datetime, but it consumed the server memory to death, sometimes 4GB is not enough for sorting the data since the total size of the logs is more than 3G.