I have two Rails 3.2.13 apps on Justhost server.
Recently they updated Mysql to Mysql2, after that I got errors:
Ruby (Rack) application could not be started
And specific:
Error message:
(Mysql2::Error)
My setup:
bundle show mysql turns : /home3/ecotec11/rails_apps/ecotechno/vendor/bundle/ruby/1.9.3/gems/mysql2-0.3.16
In database.yml
production:
adapter: mysql2
encoding: utf8
reconnect: true
database: database_name
pool: 5
username: username
password: password
# socket: /tmp/mysql.sock
Gemfile:
gem 'mysql2'
Bassicaly when I contacted support they said they can't help me.
Full backtrace of error :
0 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/mysql2-0.3.16/lib/mysql2/client.rb 24 in `initialize_ext'
1 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/mysql2-0.3.16/lib/mysql2/client.rb 24 in `initialize'
2 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/activerecord-3.2.16/lib/active_record/connection_adapters/mysql2_adapter.rb 16 in `new'
3 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/activerecord-3.2.16/lib/active_record/connection_adapters/mysql2_adapter.rb 16 in `mysql2_connection'
4 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/connection_pool.rb 315 in `new_connection'
5 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/connection_pool.rb 325 in `checkout_new_connection'
6 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/connection_pool.rb 247 in `block (2 levels) in checkout'
7 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/connection_pool.rb 242 in `loop'
8 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/connection_pool.rb 242 in `block in checkout'
9 /usr/lib64/ruby/1.9.3/monitor.rb 211 in `mon_synchronize'
10 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/connection_pool.rb 239 in `checkout'
11 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/connection_pool.rb 102 in `block in connection'
12 /usr/lib64/ruby/1.9.3/monitor.rb 211 in `mon_synchronize'
13 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/connection_pool.rb 101 in `connection'
14 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/connection_pool.rb 410 in `retrieve_connection'
15 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/connection_specification.rb 171 in `retrieve_connection'
16 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/connection_specification.rb 145 in `connection'
17 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/activerecord-3.2.16/lib/active_record/model_schema.rb 310 in `clear_cache!'
18 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/activerecord-3.2.16/lib/active_record/railtie.rb 103 in `block (2 levels) in '
19 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/activesupport-3.2.16/lib/active_support/callbacks.rb 418 in `_run__4470304995410275411__prepare__777669663684257344__callbacks'
20 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/activesupport-3.2.16/lib/active_support/callbacks.rb 405 in `__run_callback'
21 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/activesupport-3.2.16/lib/active_support/callbacks.rb 385 in `_run_prepare_callbacks'
22 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/activesupport-3.2.16/lib/active_support/callbacks.rb 81 in `run_callbacks'
23 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/actionpack-3.2.16/lib/action_dispatch/middleware/reloader.rb 74 in `prepare!'
24 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/actionpack-3.2.16/lib/action_dispatch/middleware/reloader.rb 48 in `prepare!'
25 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/railties-3.2.16/lib/rails/application/finisher.rb 47 in `block in '
26 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/railties-3.2.16/lib/rails/initializable.rb 30 in `instance_exec'
27 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/railties-3.2.16/lib/rails/initializable.rb 30 in `run'
28 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/railties-3.2.16/lib/rails/initializable.rb 55 in `block in run_initializers'
29 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/railties-3.2.16/lib/rails/initializable.rb 54 in `each'
30 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/railties-3.2.16/lib/rails/initializable.rb 54 in `run_initializers'
31 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/railties-3.2.16/lib/rails/application.rb 136 in `initialize!'
32 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/railties-3.2.16/lib/rails/railtie/configurable.rb 30 in `method_missing'
33 /home3/ecotec11/rails_apps/technorent/config/environment.rb 10 in `'
34 config.ru 3 in `require'
35 config.ru 3 in `block in
'
36 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/rack-1.4.5/lib/rack/builder.rb 51 in `instance_eval'
37 /home3/ecotec11/rails_apps/technorent/vendor/bundle/ruby/1.9.3/gems/rack-1.4.5/lib/rack/builder.rb 51 in `initialize'
38 config.ru 1 in `new'
39 config.ru 1 in `
'
40 /etc/httpd/modules/passenger/lib/phusion_passenger/rack/application_spawner.rb 225 in `eval'
41 /etc/httpd/modules/passenger/lib/phusion_passenger/rack/application_spawner.rb 225 in `load_rack_app'
42 /etc/httpd/modules/passenger/lib/phusion_passenger/rack/application_spawner.rb 157 in `block in initialize_server'
43 /etc/httpd/modules/passenger/lib/phusion_passenger/utils.rb 563 in `report_app_init_status'
44 /etc/httpd/modules/passenger/lib/phusion_passenger/rack/application_spawner.rb 154 in `initialize_server'
45 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server.rb 204 in `start_synchronously'
46 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server.rb 180 in `start'
47 /etc/httpd/modules/passenger/lib/phusion_passenger/rack/application_spawner.rb 129 in `start'
48 /etc/httpd/modules/passenger/lib/phusion_passenger/spawn_manager.rb 253 in `block (2 levels) in spawn_rack_application'
49 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server_collection.rb 132 in `lookup_or_add'
50 /etc/httpd/modules/passenger/lib/phusion_passenger/spawn_manager.rb 246 in `block in spawn_rack_application'
51 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server_collection.rb 82 in `block in synchronize'
52 prelude> 10:in `synchronize'
53 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server_collection.rb 79 in `synchronize'
54 /etc/httpd/modules/passenger/lib/phusion_passenger/spawn_manager.rb 244 in `spawn_rack_application'
55 /etc/httpd/modules/passenger/lib/phusion_passenger/spawn_manager.rb 137 in `spawn_application'
56 /etc/httpd/modules/passenger/lib/phusion_passenger/spawn_manager.rb 275 in `handle_spawn_application'
57 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server.rb 357 in `server_main_loop'
58 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server.rb 206 in `start_synchronously'
59 /etc/httpd/modules/passenger/helper-scripts/passenger-spawn-server 99 in `
In application logs :
Connecting to database specified by database.yml
Connecting to database specified by database.yml
Connecting to database specified by database.yml
Connecting to database specified by database.yml
Connecting to database specified by database.yml
Connecting to database specified by database.yml
Connecting to database specified by database.yml
I checked databases are present. Users with passwords are valid.
I tested if console works. Yes it works.
rails console production
I was able to create new record and also update existing one!
This makes me think what is wrong then ? If just for webservice database is not working ?
So from where this problem comes ?
Any tip would be great.
thanks
I solved this easily by reverting to mysql, and adding the port number 3306 to my database.yml
*for the record my app is on shared hosting on Bluehost.
previous database.yml:
development:
adapter: mysql2
database: my_db
encoding: utf8
username: my_username
password: my_password
host: localhost
reconnect: true
current database.yml:
development:
adapter: mysql
database: my_db
encoding: utf8
username: my_username
password: my_password
host: 127.0.0.1
reconnect: true
socket: mysql
port: 3306
Related
I am able to set up Splunk in OpenShift and install splunk-connect using helm. I did create indexes and enable HEC (HTTP Event Collector) and created a HEC token. Splunk HEC values.yaml is completed with appropriate values. All pods are up and running but i am seeing no OpenShift logs in Splunk. Error I am seeing
use_rest_client_ssl true
1282
cluster_name openshiftlab
1283
interval 15s
1284
</source> is not used.
1285
2022-08-19 13:22:22 +0000 [info]: #0 starting fluentd worker pid=186 ppid=1 worker=0
1286
2022-08-19 13:22:22 +0000 [error]: #0 unexpected error error_class=RestClient::SSLCertificateNotVerified error="SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate)"
1287
2022-08-19 13:22:22 +0000 [error]: #0 /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/request.rb:776:in `rescue in transmit'
1288
2022-08-19 13:22:22 +0000 [error]: #0 /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/request.rb:651:in `transmit'
1289
2022-08-19 13:22:22 +0000 [error]: #0 /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/request.rb:163:in `execute'
1290
2022-08-19 13:22:22 +0000 [error]: #0 /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/request.rb:63:in `execute'
1291
2022-08-19 13:22:22 +0000 [error]: #0 /opt/app-root/src/gem/fluent-plugin-kubernetes-metrics-1.2.0/lib/fluent/plugin/in_kubernetes_metrics.rb:695:in `is_stats_endpoint_available?'
1292
2022-08-19 13:22:22 +0000 [error]: #0 /opt/app-root/src/gem/fluent-plugin-kubernetes-metrics-1.2.0/lib/fluent/plugin/in_kubernetes_metrics.rb:95:in `start'
1293
2022-08-19 13:22:22 +0000 [error]: #0 /usr/share/gems/gems/fluentd-1.15.1/lib/fluent/root_agent.rb:203:in `block in start'
1294
2022-08-19 13:22:22 +0000 [error]: #0 /usr/share/gems/gems/fluentd-1.15.1/lib/fluent/root_agent.rb:192:in `block (2 levels) in lifecycle'
1295
2022-08-19 13:22:22 +0000 [error]: #0 /usr/share/gems/gems/fluentd-1.15.1/lib/fluent/root_agent.rb:191:in `each'
1296
2022-08-19 13:22:22 +0000 [error]: #0 /usr/share/gems/gems/fluentd-1.15.1/lib/fluent/root_agent.rb:191:in `block in lifecycle'
1297
2022-08-19 13:22:22 +0000 [error]: #0 /usr/share/gems/gems/fluentd-1.15.1/lib/fluent/root_agent.rb:178:in `each'
1298
2022-08-19 13:22:22 +0000 [error]: #0 /usr/share/gems/gems/fluentd-1.15.1/lib/fluent/root_agent.rb:178:in `lifecycle'
1299
2022-08-19 13:22:22 +0000 [error]: #0 /usr/share/gems/gems/fluentd-1.15.1/lib/fluent/root_agent.rb:202:in `start'
1300
2022-08-19 13:22:22 +0000 [error]: #0 /usr/share/gems/gems/fluentd-1.15.1/lib/fluent/engine.rb:248:in `start'
1301
2022-08-19 13:22:22 +0000 [error]: #0 /usr/share/gems/gems/fluentd-1.15.1/lib/fluent/engine.rb:147:in `run'
1302
2022-08-19 13:22:22 +0000 [error]: #0 /usr/share/gems/gems/fluentd-1.15.1/lib/fluent/supervisor.rb:760:in `block in run_worker'
1303
2022-08-19 13:22:22 +0000 [error]: #0 /usr/share/gems/gems/fluentd-1.15.1/lib/fluent/supervisor.rb:1036:in `main_process'
1304
2022-08-19 13:22:22 +0000 [error]: #0 /usr/share/gems/gems/fluentd-1.15.1/lib/fluent/supervisor.rb:751:in `run_worker'
1305
2022-08-19 13:22:22 +0000 [error]: #0 /usr/share/gems/gems/fluentd-1.15.1/lib/fluent/command/fluentd.rb:386:in `<top (required)>'
1306
2022-08-19 13:22:22 +0000 [error]: #0 /usr/share/gems/gems/fluentd-1.15.1/bin/fluentd:15:in `require'
1307
2022-08-19 13:22:22 +0000 [error]: #0 /usr/share/gems/gems/fluentd-1.15.1/bin/fluentd:15:in `<top (required)>'
1308
2022-08-19 13:22:22 +0000 [error]: #0 /usr/bin/fluentd:23:in `load'
1309
2022-08-19 13:22:22 +0000 [error]: #0 /usr/bin/fluentd:23:in `<main>'
1310
2022-08-19 13:22:22 +0000 [error]: #0 unexpected error error_class=RestClient::SSLCertificateNotVerified error="SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate)"
Did you try setting insecureSSL: true in the values.yaml file and then redeploying?
I'm writing a arbitrary JSON parser for golang, the project nearly finished. But I found a confusing problem about the performance:
I want to test the performance about parse a big(100Mb) JSON string, I use the test file itself to init the JSON struct in memory and write the marshaled JSON string to a file, and then read from it, if the file exists already, will not init it in memory, just read from file directly. The performance is totally different: cost about double time to parse when read from file directly. At the same time, I'm testing the performance about parse normal(1Kb) JSON string and deep(2Mb) JSON string, both of these are almost unaffected.
Why? is CPU cache? or GC? or any else?
The code at https://github.com/acrazing/cheapjson, and I opened a issue about this problem at https://github.com/acrazing/cheapjson/issues/1. You can get more detailed information about the benchmark from here.
I am unable to reproduce your issue: https://github.com/acrazing/cheapjson/issues/1. My benchmark results:
$ go version
go version devel +b817359 Sat Jul 22 01:29:58 2017 +0000 linux/amd64
$ rm -rf data
$ ls -la data
ls: cannot access 'data': No such file or directory
$ go test -v -run=! -bench=. -benchmem parser_test.go
2017/07/23 02:42:09 big input size: 117265882, normal input size: 763, deep input size: 2134832
goos: linux
goarch: amd64
BenchmarkUnmarshalBigInput-4 1 1107362634 ns/op 278192256 B/op 8280859 allocs/op
BenchmarkSimpleJsonBigInput-4 1 2680878194 ns/op 569595680 B/op 7575252 allocs/op
BenchmarkUnmarshalNormalInput-4 300000 5685 ns/op 4622 B/op 129 allocs/op
BenchmarkSimpleJsonNormalInput-4 200000 9565 ns/op 5602 B/op 87 allocs/op
BenchmarkUnmarshalDeepInput-4 1000 2085186 ns/op 372922 B/op 5134 allocs/op
BenchmarkSimpleJsonDeepInput-4 100 12311435 ns/op 8911102 B/op 6117 allocs/op
PASS
ok command-line-arguments 15.067s
$ ls -la datatotal 116620
drwxr-xr-x 2 peter peter 4096 Jul 23 02:42 .
drwxr-xr-x 5 peter peter 4096 Jul 23 02:42 ..
-rwxr-xr-x 1 peter peter 117265882 Jul 23 02:42 big.json
-rwxr-xr-x 1 peter peter 2134832 Jul 23 02:42 deep.json
-rwxr-xr-x 1 peter peter 763 Jul 23 02:42 normal.json
$ go test -v -run=! -bench=. -benchmem parser_test.go
2017/07/23 02:42:31 big input size: 117265882, normal input size: 763, deep input size: 2134832
goos: linux
goarch: amd64
BenchmarkUnmarshalBigInput-4 1 1140498937 ns/op 278220704 B/op 8280995 allocs/op
BenchmarkSimpleJsonBigInput-4 1 2685285322 ns/op 569592608 B/op 7575242 allocs/op
BenchmarkUnmarshalNormalInput-4 300000 5685 ns/op 4622 B/op 129 allocs/op
BenchmarkSimpleJsonNormalInput-4 200000 9633 ns/op 5601 B/op 87 allocs/op
BenchmarkUnmarshalDeepInput-4 1000 2086891 ns/op 372927 B/op 5134 allocs/op
BenchmarkSimpleJsonDeepInput-4 100 12387413 ns/op 8911084 B/op 6117 allocs/op
PASS
ok command-line-arguments 11.903s
$ ls -la data
total 116624
drwxr-xr-x 2 peter peter 4096 Jul 23 02:42 .
drwxr-xr-x 5 peter peter 4096 Jul 23 02:42 ..
-rwxr-xr-x 1 peter peter 117265882 Jul 23 02:42 big.json
-rwxr-xr-x 1 peter peter 2134832 Jul 23 02:42 deep.json
-rwxr-xr-x 1 peter peter 763 Jul 23 02:42 normal.json
$
I got similar results on four different machines and two Operating systems: three Linux and one Windows.
This is the old benchmark result, time is at 11:01
This is the final test result currently, the result could not reproduce, it's amazing.
I have a lot of small binary log files , each of them just only 126 Bytes
-rw-rw----. 1 mysql mysql 126 Jan 6 16:13 mysql-bin.000001
-rw-rw----. 1 mysql mysql 126 Jan 6 16:16 mysql-bin.000002
-rw-rw----. 1 mysql mysql 150 Jan 7 10:34 mysql-bin.000003
-rw-rw----. 1 mysql mysql 126 Jan 8 09:57 mysql-bin.000004
-rw-rw----. 1 mysql mysql 126 Jan 8 11:08 mysql-bin.000005
-rw-rw----. 1 mysql mysql 107 Jan 8 11:09 mysql-bin.000006
-rw-rw----. 1 mysql mysql 126 Jan 8 13:21 mysql-bin.000007
-rw-rw----. 1 mysql mysql 342 Jan 8 16:25 mysql-bin.index
how to let them grow bigger? and my "binlog_cache_size" is more than 126 Byte
mysql> show variables like 'binlog_cache_size';
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 1
Current database: test
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| binlog_cache_size | 32768 |
+-------------------+-------+
1 row in set (0.00 sec)
can anybody tell me why(⊙ˍ⊙) ? thank you very much :)
I have tried to show how many files are open via this command:
lsof | awk '{print $1" "$2}' | uniq -c | sort -n -r
and here is result:
717 mysqld 1762
188 httpd 5171
185 httpd 5145
184 httpd 5631
184 httpd 5488
184 httpd 5150
184 httpd 3824
184 httpd 3819
184 httpd 3811
184 httpd 3483
184 httpd 3255
184 httpd 3249
184 httpd 3236
184 httpd 3230
183 httpd 5655
183 httpd 5490
183 httpd 5489
183 httpd 5487
183 httpd 5465
183 httpd 5464
183 httpd 5149
183 httpd 4480
183 httpd 4479
183 httpd 4478
183 httpd 4477
183 httpd 4474
183 httpd 4473
183 httpd 4459
183 httpd 3490
183 httpd 3489
183 httpd 3488
183 httpd 3487
183 httpd 3484
183 httpd 3478
183 httpd 3326
183 httpd 3235
183 httpd 3234
183 httpd 3233
183 httpd 3231
183 httpd 3229
183 httpd 10551
183 httpd 10317
183 httpd 10316
183 httpd 10291
182 httpd 10602
182 httpd 10601
182 httpd 10281
174 httpd 5443
174 httpd 3319
174 httpd 10603
174 httpd 10596
174 httpd 10578
174 httpd 10577
174 httpd 10552
174 httpd 10531
173 httpd 10576
173 httpd 10378
173 httpd 10319
173 httpd 10318
171 httpd 3226
137 master 1985
118 dovecot 1854
74 newrelic- 1880
63 sshd 8631
62 auth 11282
57 fail2ban- 2107
56 auth 11283
49 qmgr 2007
49 pickup 31235
44 squid 2061
44 memcached 1002
41 sshd 1183
37 squid 2059
34 log 1857
27 vsftpd 1206
27 imap 7971
24 anvil 1855
22 config 11280
20 rsyslogd 869
20 init 1
19 udevd 363
19 crond 2042
15 unlinkd 2063
15 udevd 911
15 udevd 910
15 mysqld_sa 1246
15 lsof 11502
15 bash 8687
13 acpid 895
12 sort 11505
12 awk 11503
10 newrelic- 1879
10 lsof 11506
10 irqbalanc 884
9 uniq 11504
8 mingetty 2155
3 xenwatch 23
3 xenbus 24
3 sync_supe 56
3 netns 19
3 migration 9
3 migration 7
3 migration 5
3 migration 4
3 kthreadd 2
3 kswapd0 117
3 kstriped 292
3 ksoftirqd 8
3 ksoftirqd 6
3 ksoftirqd 3
3 ksoftirqd 10
3 ksnapd 296
3 kseriod 68
3 kjournald 318
3 khvcd 136
3 khelper 16
3 kblockd/3 63
3 kblockd/2 62
3 kblockd/1 61
3 kblockd/0 60
3 kauditd 570
3 flush-202 725
3 events/3 14
3 events/2 13
3 events/1 12
3 events/0 11
3 crypto/3 125
3 crypto/2 124
3 crypto/1 123
3 crypto/0 122
3 cpuset 15
3 bdi-defau 58
3 async/mgr 20
3 aio/3 121
3 aio/2 120
3 aio/1 119
3 aio/0 118
1 COMMAND PID
Folks, could you please tell me why Apache open so many files? I have disabled access_log directive at httpd.conf but it not helps me.
Thx
If you look at the actual results (lsof|grep httpd), you will see that each parent process has open handles to each module that is loaded, so your modules (e.g. mod_rewrite) will be in the open file list.
Each process will also have a handle to the error_log file, lib files required to run httpd or any modules, and at least one pipe per process for IPC.
If you are serving a lot of static files and you have a busy site, chances are you will see some of those files open too.
Really none of this should be much of an issue. And keep in mind, the more Server processes you have running, the more open files there will be since each parent process will open many of the same files (in particular the modules and log files).
I originally posted this at Super User, but now think it should be here instead...
I'm trying to port my RoR webapp over to a DreamHost VPS. I've upgraded the VPS --> Ruby 1.9.2 from 1.8.7 and am using Rails 3.0.1 and the mysql2 (0.2.6) gem. I'm getting the following error when trying to start mongrel:
/usr/bin/ruby1.8: symbol lookup error: /home/USERNAME/.gems/gems/mysql2-0.2.6/lib/mysql2/mysql2.so: undefined symbol: rb_intern2
...so I tried using the mysql (2.8.1) gem instead and get the following error:
wrong argument type Mysql (expected Struct) (TypeError)
0 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 600 in real_connect'
1 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 600 inconnect'
2 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 164 in initialize'
3 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 36 innew'
4 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 36 in mysql_connection'
5 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 230 insend'
6 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 230 in new_connection'
7 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 238 incheckout_new_connection'
8 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 194 in checkout'
9 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 190 inloop'
10 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 190 in checkout'
11 /usr/lib/ruby/1.8/monitor.rb 242 insynchronize'
12 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 189 in checkout'
13 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 96 inconnection'
14 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 318 in retrieve_connection'
15 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb 97 inretrieve_connection'
16 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb 89 in connection'
17 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/associations.rb 1804 increate_has_and_belongs_to_many_reflection'
18 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/associations.rb 1411 in has_and_belongs_to_many'
19 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/autosave_association.rb 137 inhas_and_belongs_to_many'
20 /home/USERNAME/portfoliofinearts.ca/farr/app/models/project.rb 3
21 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 239 in require'
22 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 239 inrequire'
23 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 227 in load_dependency'
24 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 239 inrequire'
25 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 346 in require_or_load'
26 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 300 independ_on'
27 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 216 in require_dependency'
28 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 138 ineager_load!'
29 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 137 in each'
30 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 137 ineager_load!'
31 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 135 in each'
32 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 135 ineager_load!'
33 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 108 in eager_load!'
34 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application/finisher.rb 41
35 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initializable.rb 25 ininstance_exec'
36 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initializable.rb 25 in run'
37 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initializable.rb 50 inrun_initializers'
38 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initializable.rb 49 in each'
39 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initializable.rb 49 inrun_initializers'
40 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 134 in initialize!'
41 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 77 insend'
42 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 77 in method_missing'
43 /home/USERNAME/mydomain.com/test_app/config/environment.rb 10
44 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 ingem_original_require'
45 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in require'
46 config.ru 3
47 /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb 46 ininstance_eval'
48 /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb 46 in initialize'
49 config.ru 1 innew'
50 config.ru 1
I'd prefer to use mysql2, so that's the preferred solution I'm looking for, but I will certainly appreciate input on either problem.
I'm not encountering any problems such as this in my development environment (which is windows)
You'd mentioned that you're running Ruby 1.9.2 but your error dump looks like it's running Ruby 1.8 I'm not sure that this would cause the problem or not but it seems like a potential issue.
I'd uninstall ruby1.8 and see if it fixes anything.
sudo apt-get remove ruby1.8