2

I am considering to change all of my server locale to C by

"export LC_ALL=C"

Is it a common practice?

I am thinking will there be any side effect on a LAMP server, or should I just leave as using the default of "en_US.UTF-8"?

Ryan
  • 5,341
  • 21
  • 71
  • 87
  • 1
    What do you hope to accomplish by changing this value? – joev Aug 14 '13 at 01:07
  • To avoid issue like this: http://tdas.wordpress.com/2008/02/03/speed-up-grep/ – Ryan Aug 14 '13 at 03:55
  • That issue was reported over five years ago; have you been able to run a test with a more recent version of grep? There's a decent chance that the performance is better, given that UTF-8 is becoming more and more prevalent. – joev Aug 14 '13 at 12:40

1 Answers1

1

You might want to edit /etc/default/locale to set the locale as your export command will only affect the current environment. It will not affect already running programs.

The issue you had mentioned regarding grep was fixed a few years ago already:

fixed in grep 2.7, released Sep 20, 2010

In multibyte locales, regular expressions including backreferences
no longer exhibit quadratic complexity (i.e., they are orders
of magnitude faster). [bug present since multi-byte character set
support was introduced in 2.5.2]

In UTF-8 locales, regular expressions including "." can be orders
of magnitude faster.  For example, "grep ." is now twice as fast
as "grep -v ^$", instead of being immensely slower.  It remains
slow in other multibyte locales. [bug present since multi-byte
character set support was introduced in 2.5.2]

http://savannah.gnu.org/forum/forum.php?forum_id=6521

user228505
  • 156
  • 3