Ever since I started using Vhosts with MAMP, page requests have been quite slow. It takes 3 to 5 seconds or more to process a page request. I'm wondering if it's the way my hosts or vhosts files are setup:

hosts:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1   localhost

255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0 localhost

127.0.0.1 mysite.local www.mysite.local
127.0.0.1 anothersite.local www.anothersite.local

httpd-vhosts.conf

NameVirtualHost *:80

<VirtualHost *:80>
    ServerName mysite.local
    ServerAlias www.mysite.local
    DocumentRoot /Users/username/Sites/mysite.local/
    <Directory /Users/username/Sites/mysite.local/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName anothersite.local
    ServerAlias www.anothersite.local
    DocumentRoot /Users/username/Sites/anothersite.local/
    <Directory /Users/username/Sites/anothersite.local/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>

Your help is greatly appreciated!

link|improve this question

50% accept rate
feedback

2 Answers

Change your ServerNames to example.dev or something other than .local. Forgot the technical explanation but basically, .local is used by Bonjour.

link|improve this answer
I swear Apple used .local for mDNS and Bonjour just to make like difficult for companies with active directory and a .local TLD (which is almost all of them). – Mark Henderson Nov 25 '11 at 20:15
feedback

The hosts resolution process for things in /etc/hosts/ is very, very fast, even if there are hundreds of host declarations in there. The name-service cache daemon keeps such lookups in memory as well, so they should be even faster.

The problem is most likely somewhere else.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.