Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

A remote server runs code terribley slow

Explorer ,
Jan 12, 2009 Jan 12, 2009
Hello,

I'm in an odd development situation. I write code on my local dev server, which gets handed off to someone else's dev server that tests it before putting it up live. I have NO direct access to the remote servers and upload my files by emailing them over individually with instructions on where to place them. (I warned you it was odd).

I've written a small search page which does the following: does a verity search, if a result is not cached then the file is parsed then the information is cached. It sorts the results, then displays them. It caches by serializing a struct of structs using wddx.

On my local server this works almost instantaneously, literally half a second for the largest "all" search, but on the remote server it TIMES OUT! Doing searches (that run near instantly locally) for less items takes upwards of 2 full minutes.

The error that coldfusion throws is that cffile write is timing out. (It rewrites the cache if it finds new files in the results).

The code is identical on both my local, and the remote server.

I'm a little clueless as to why this is happening, and my background has never been in coldfusion before. If anyone could shed any light on why this is happening, or where to look to figure out why it's happening, it would be greatly appreciated!

Thank you so much for any help you can give.
719
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Jan 13, 2009 Jan 13, 2009
Thank you to all of you who responded. I wrote some performance monitoring using getTickCount() to figure out where the program was grinding. Turns out I had my cache writing inside the main loop. Once I moved the file i/o to where it was supposed to be it all worked fine. The reason it timed out there is because their server is much slower, even slower than my local pentium 4 which was a bit of a surprised.

Thanks again, you're a helpful bunch.
Translate
Advocate ,
Jan 12, 2009 Jan 12, 2009
The code is identical, sure, but is the information, and particularly the amount of information, being indexed and/or cached the same?

Look at the size of those files being written and compare them to the file sizes being written on your dev server. Are the files on the remote server much larger?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 12, 2009 Jan 12, 2009
Kronin, you bring up a good point, and that has been the main focus I've had so far. In my local environment I am searching through roughly 1100 files. The Cache file i'm making comes out to about 800KB. In the remote environment I'm only searching through roughly 2000 files, and I am assuming that the cache is growing at the same rate.

These aren't terribly big numbers I'm working with, even the oldest hardware should be able to pull this off without a hitch. Even if cffile loads it into memory first, there would surely be 1MB of memory available, and if not a swap shouldn't take long enough to cause a time out.

Keep the ideas coming though 🙂
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 12, 2009 Jan 12, 2009
Is the production server a dedicated server, or is it shared with a bunch of other websites?

If you run a tracert to the production server, are there any significant bottlenecks?

Are the other pages you own on that server slow to respond as well, or is it just this one?

Do you know the specifications of the server in question?

What kind of traffic exists on the server? Heavy? Light? Unknown?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 12, 2009 Jan 12, 2009
> What kind of traffic exists on the server? Heavy? Light? Unknown?

This was my first thought. Your local box has just *you* on it, the
production box - I would think - has more people using the site than just
one.

Have you tetsed your local environment under load?

What happens if more than one request wants to write to that file at the
same time?

--
Adam
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 13, 2009 Jan 13, 2009
LATEST
Thank you to all of you who responded. I wrote some performance monitoring using getTickCount() to figure out where the program was grinding. Turns out I had my cache writing inside the main loop. Once I moved the file i/o to where it was supposed to be it all worked fine. The reason it timed out there is because their server is much slower, even slower than my local pentium 4 which was a bit of a surprised.

Thanks again, you're a helpful bunch.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources