2

We are 2 working on a website with Ruby on Rails that receives GPS coordinates sent by a tracking system we developped. This tracking system send 10 coordinates every 10 seconds.

We have 2 servers to test our website and we noticed that one server is processing the 10 coordinates very quickly (less than 0.5 s) whereas the other server is processing the 10 coordinates in 5 seconds minimum (up to 20 seconds). We are supposed to use the "slow" server to put our website in production mode this is why we would try to solve this issue.

Here is an image showing the time response of the slow server (on the bottom we can see 8593 ms).

Slow Server

The second image shows the time response of the "quick" server.

Fast Server

The version of the website is the same. We upload it via Github.

We can easily reproduce the problem by sending fake coordinates with POSTMan and difference of time between the two servers remain the same. This means the problem does not come from our tracking system in my opinion.

I come here to find out what can be the origins of such difference. I guess it can be a problem from the server itself, or from some settings that are not imported with Github.

We use Sqlite3 for our database.

However I do not even know where to look to find the possible differences...

If you need further information (such as lscpu => I am limited to a number of 2 links...) in order to help me, please do not hesitate. I will reply very quickly as I work on it all day long.

Thank you in advance.

EDIT : here are the returns of the lscpu commands on the server.

Fast Server : enter image description here

Slow Server : enter image description here

May be one big difference is the L2 cache...

My guess is that the answer is here but how can I know what is my value of pragma synchronous and how can I change it ?

The size of the .sqlite3 file I use is under 1 Mo for the tests. Both databases should be identical according to my schema.rb file.

Community
  • 1
  • 1
Jahaa
  • 21
  • 2
  • Are the servers running different hardware / enviroments? Is your "production" server is running some extremely slow shared hosting? – gernberg Aug 25 '15 at 15:24
  • - what is the size of the data that you have in each server? - does one of the database have index and the other not? - is there any major difference in memory used in both cases? – tomsoft Aug 25 '15 at 15:24
  • My guess that [http://stackoverflow.com/questions/15413575/why-is-sqlite-so-slow-2-q-s-on-a-specific-machine](this) may the source of the problem. However, I do not know how to know the value I am using for pragma synchronous and how to change it. @gernberg : I do not know the hardware of the server. The slow one is said to be a virtual one and I asked confirmation of this. Both are using linux. I am a still using the "development" environment of ruby on rails but I do not think I run some extremely low shared hosting (btw, I may not understand what you mean). – Jahaa Aug 25 '15 at 17:13
  • @tomsoft : The file development.sqlite3 that represents the data base is under 1 Mo for the tests. How can I know if one have an index and the other one has not ? I use Ruby On Rails with sqlite3, it should handle this automatically. How can I check the memory used in both cases ? But it may be rather the same. – Jahaa Aug 25 '15 at 17:27

1 Answers1

0

The provider of the "slow" server solved the problem, however I do not know the details. Some things were consuming memory and slowing down everything.

By virtual server, it means finally that several servers are running on the same machine, each is attributed a part of the machine.

Thanks a lot for your help.

Jahaa
  • 21
  • 2