0

When developing on my mac the default localhost server runs very slowly compared to the mamp server.

I ran nmap on the both servers and got back a significant difference. Unfortunately, this is out of my realm of knowledge. What does it mean and is there a way I can fix the default localhost to run faster?

****-MBP:~ ****$ nmap localhost

Starting Nmap 5.51 ( http://nmap.org ) at 2012-05-01 14:12 CDT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00056s latency).
Not shown: 499 closed ports, 491 filtered ports
PORT      STATE SERVICE
80/tcp    open  http
88/tcp    open  kerberos-sec
548/tcp   open  afp
631/tcp   open  ipp
3389/tcp  open  ms-term-serv
3689/tcp  open  rendezvous
5900/tcp  open  vnc
8888/tcp  open  sun-answerbook
49155/tcp open  unknown
49156/tcp open  unknown

Nmap done: 1 IP address (1 host up) scanned in 2.46 seconds
****-MBP:~ ****$ nmap -p 8888 localhost

Starting Nmap 5.51 ( http://nmap.org ) at 2012-05-01 14:12 CDT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00013s latency).
PORT     STATE SERVICE
8888/tcp open  sun-answerbook

Nmap done: 1 IP address (1 host up) scanned in 0.03 seconds
say
  • 101
  • 1
    Can you clarify what you're trying to show us with the nmap? Scanning the default 1000 common ports should take a thousand times longer than scanning one port at the same timing setting (which is exactly what you're seeing), and really gives no information on the speed of the web server. Can you clarify what kind of slowness you're seeing, what you're serving with the web server, and what your configuration looks like? – Shane Madden May 01 '12 at 19:29
  • sure, sorry for the lack of context. os x 10.7.3, macbook pro 2.2 i7 16gb of ram. When I refer to the "default localhost" i mean the built in server you get when tuning on web sharing in the system preferences. Alternatively, the server run using mamp uses port 8888. I'm serving simple HTML files from my sites directory. The majority of my problem happens when I am simply refreshing the browser after making a change. The default server take a few seconds vs the mamp that is immediately. Hopefully that help with the context. – say May 01 '12 at 19:44
  • oh, regarding nmap. No idea. I am simply looking for something to compare the difference between localhost and localhost:8888. I'm ignorant to the whole server side stuff - not even sure if running nmap is useful. (newb here). – say May 01 '12 at 19:47

1 Answers1

1

curl is installed by default on MacOS. Try running:

curl --trace trace.log --trace-time -o /dev/null <URL>

against both of your URLs. (It'll write timing output to 'trace.log', so either rename the file between runs or change the filename on the command line.)

Then examine the log files' timestamps and see if you can find where the delays are occurring.

wfaulk
  • 6,828
  • 7
  • 45
  • 75