in reply to Simple script goes from 2s to ~2mins when run on VPS
Warning: I know nothing about Mojo; I've never used or worked with a VPS; and don't really have much of a clue about web work.
My suggestion: If you are timing this from a client connecting to whatever this is; time the second instance, rather than the first.
That is: if you are timing this remotely, make one connection from your browser (or other client); then make a second connection and time that.
Rational. Virtual servers tend to be implemented as front-end stub that causes virtual machine instance to be loaded on demand. Thus, the first request to a VPS (within some time period) will require: a real server with 'space' to be allocated; the VM image to be located and loaded -- possibly from cold storage; that instance to be initialised; and then the request redirected to it.
Whereas and second (and subsequent) request within the same time period, only needs to redirect to the already existing and running VM instance.
That is the only reason I can imagine for a remote VM to be 50 times slower than a local VM.
|
|---|