Compiling and Linking an Optimized
mysqld
Server
126
libmysql.c:1329: warning: passing arg 5 of `gethostbyname_r' from
incompatible pointer type
libmysql.c:1329: too few arguments to function `gethostbyname_r'
libmysql.c:1329: warning: assignment makes pointer from integer
without a cast
make[2]: *** [libmysql.lo] Error 1
By default, the
configure
script attempts to determine the correct number of arguments by using
g++
(the GNU C++ compiler). This test yields incorrect results if
g++
is not installed. There are two
ways to work around this problem:
• Make sure that the GNU C++
g++
is installed. On some Linux distributions, the required package
is called
gpp
; on others, it is named
gcc-c++
.
• Use
gcc
as your C++ compiler by setting the
CXX
environment variable to
gcc
:
export CXX="gcc"
You must run
configure
again after making either of those changes.
For information about acquiring or updating tools, see the system requirements in
Section 2.17,
“Installing MySQL from Source”
.
2.17.5. Compiling and Linking an Optimized
mysqld
Server
Most of the following tests were performed on Linux with the MySQL benchmarks, but they should give
some indication for other operating systems and workloads.
You obtain the fastest executables when you link with
-static
.
By using better compiler and compilation options, you can obtain a 10% to 30% speed increase in
applications. This is particularly important if you compile the MySQL server yourself.
When we tested both the Cygnus CodeFusion and Fujitsu compilers, neither was sufficiently bug-free
to enable MySQL to be compiled with optimizations enabled.
The standard MySQL binary distributions are compiled with support for all character sets. When you
compile MySQL yourself, you should include support only for the character sets that you are going to
use. This is controlled by the
--with-charset
[122]
option to
configure
.
Here is a list of some measurements that we have made:
• If you link dynamically (without
-static
), the result is 13% slower on Linux. Note that you still can
use a dynamically linked MySQL library for your client applications. It is the server that is most critical
for performance.
• For a connection from a client to a server running on the same host, if you connect using TCP/IP
rather than a Unix socket file, performance is 7.5% slower. (On Unix, if you connect to the host name
localhost
, MySQL uses a socket file by default.)
• For TCP/IP connections from a client to a server, connecting to a remote server on another host is
8% to 11% slower than connecting to a server on the same host, even for connections faster than
100Mb/s Ethernet.
• When running our benchmark tests using secure connections (all data encrypted with internal SSL
support) performance was 55% slower than with unencrypted connections.
• If you compile with
--with-debug=full
[122]
, most queries are 20% slower. Some queries may
take substantially longer; for example, the MySQL benchmarks run 35% slower. If you use
--with-
debug
[122]
(without
=full
), the speed decrease is only 15%. For a version of
mysqld
that has
been compiled with
--with-debug=full
[122]
, you can disable memory checking at runtime by
starting it with the
--skip-safemalloc
[421]
option. The execution speed should then be close
to that obtained when configuring with
--with-debug
[122]
.
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...