CygwinのFAQサイト を検索してみた。
以下、Cygwinのページから引用。
4.2. Starting a new terminal window is slow. What’s going on?
There are many possible causes for this.
~snip~
For almost all its lifetime, Cygwin has used Unix-like /etc/passwd and /etc/group files to mirror the contents of the Windows SAM and AD databases. Although these files can still be used, since Cygwin 1.7.34, new installations now use the SAM/AD databases directly.
To switch to the new method, move these two files out of the way and restart the Cygwin terminal. That runs Cygwin in its new default mode.
~snip~
For the AD case, it can be slower than the old method, since it is trading a local file read for a network request. Version 1.7.35 will reduce the number of AD server requests the DLL makes relative to 1.7.34, with the consequence that you will now have to alter /etc/nsswitch.conf in order to change your Cygwin home directory, instead of being able to change it from the AD configuration.
If you are still experiencing very slow shell startups, there are a number of other things you can look into:
One common cause of slow Cygwin Terminal starts is a bad DNS setup. This particularly affects AD clients, but there may be other things in your Cygwin startup that depend on getting fast answers back from a network server.
~snip~
Another cause for AD client system is slow DC replies, commonly observed in configurations with remote DC access. The Cygwin DLL queries information about every group you’re in to populate the local cache on startup. You may speed up this process a little by caching your own information in local files. Run these commands in a Cygwin terminal with write access to /etc:
getent passwd $(id -u) > /etc/passwd getent group $(id -G) > /etc/group Also, set /etc/nsswitch.conf as follows:
passwd: files db group: files db
~snip~
Either in addition to the previous item or instead of it, you can run cygserver as a local caching service to speed up DC requests.
~snip~
A less preferable option is to create a static read-only cache of the authentication data. This is the old-fashioned method of making Cygwin integrate with AD, the only method available in releases before 1.7.34. To do this, run mkpasswd and mkgroup, then put the following into /etc/nsswitch.conf to make Cygwin treat these files as the only sources of user and group information:
passwd: files group: files
~snip~
If none of the above helps, the best troubleshooting method is to run your startup scripts in debug mode. Right-click your Cygwin Terminal
~snip~
4.3. Why is Cygwin suddenly so slow?
If suddenly every command takes a very long time, then something is probably attempting to access a network share. You may have the obsolete //c notation in your PATH or startup files. Using //c means to contact the network server c, which will slow things down tremendously if it does not exist.
要するに、ドメインで使っている会社のPCで遅くなる原因は。。。
- cygwinを 1.7.35 以降の最近のバージョンにする (古いのは遅い)
- DNSのIPアドレスが間違っていると、長い待ちがおこる
- ドメインじゃないなら、 /etc/passwd と /etc/group を消すと良いかも(知れない)
- ドメインなら、ドメインコントローラの返事が遅いのかも
- その場合、passwd/group をキャッシュして高速化できる
- cygserverでドメンインキャッシュサーバをたててみても良いぞ
- そもそもドメインにアクセスするの辞めちゃえば? (ADが更新しても知らんけど)
- それでもダメならデバッグモードで起動してみな
- ひょっとして ‘//c’ とか書いてない?
DNSが関係しているのは分かっていたけど、 会社のドメインコントローラが遅いとは疑っていなかった。 Windowsでは困ったことないし。
でもやってみよう。