Author Topic: What’s the point of hashing passwords over an insecure connection?  (Read 15891 times)

Offline Reverend Greed

  • PLA Guru
  • *****
  • Posts: 224
  • 1337 13V3L: +42/-7
Reverend:

I'm having some serious slow-downs on the peak hours of my forum. (SMF 1.0.8, PHP 4.4.0, MySQL 4.1.14-standard)
This is a very big forum (80K page views/day, 200+ users online 24/7, and around 900 messages per day) using a dedicated server running on Dual Xeon 2.4GB and 2GB DDR.

it seems like the memory is EXTREMELY HIGH (80-95%).. I guess this is the bottleneck ? the only solution is to get more RAM (I already have 2GB..) ?
I noticed that it doesn't use almost any SWAP (0.153%..).. it's a problem, or maybe the server is simply configured to use all the real memory before going to the swap, and that's why it's 95% (?!$?!) full ?

It seems you have a memory problem.  First, upgrade to 1.1.3 because of the better usage of eAccelerator's cache and the rewritten search engine.

Also, I need you to post your status.php server information so that I can examine it in order of having a better comprehension of what's going on.
Reboot America

Offline silentfreak

  • Junior Phone Loser
  • **
  • Posts: 28
  • 1337 13V3L: +1/-7
Here --

CPU: mysqld (201) 63.1%, httpd (107) 46.1%
Memory: 92.832% (1925884k / 2074580k)
MySQL: 95 (87 sleeping, 3 running, 5 locked)

Offline Reverend Greed

  • PLA Guru
  • *****
  • Posts: 224
  • 1337 13V3L: +42/-7
Here --

CPU: mysqld (201) 63.1%, httpd (107) 46.1%
Memory: 92.832% (1925884k / 2074580k)
MySQL: 95 (87 sleeping, 3 running, 5 locked)

This tells me you are not yet using InnoDB, and that you are not efficiently using your memory.  So, the following are the steps I would take:

1. Convert your tables to InnoDB.
2. Your MySQL settings could use some love.
  - for table_cache, I would recommend 1024.
  - key_buffer_size should be increased, I suggest 16M.
  - thread_cache_size should be non-zero, perhaps 8 is good to start with.
  - query_cache_size should be non-zero, I strongly suggest trying 24M or so to start.
3. Since Apache is using so much CPU, I would assume you don't have an accelerator installed?

Reboot America

Offline silentfreak

  • Junior Phone Loser
  • **
  • Posts: 28
  • 1337 13V3L: +1/-7
How do you change the MySQL settings.  I have root access to it but I'm not familiar with it.  I read some docs at their site.  Its hard to understand.

Offline Reverend Greed

  • PLA Guru
  • *****
  • Posts: 224
  • 1337 13V3L: +42/-7
As root - go to /etc/my.cnf  and open to find this:

Code: [Select]
[section]
...

[section]
...

Under it, you can add settings.  For your MySQL it's simply:  setting_name = value

There are two things to keep in mind about the value.  If it is not numeric, you have to quote it ('hello'), and if it has a unit (15M), you have to multiply it out.  For example, M means * 1024 * 1024, so you might use:

SET @@global.setting_name = 15 * 1024 * 1024;

Other expressions are, of course, allowed too.  This change should be relatively immediate, but if you restart mysqld it will revert to whatever is in my.cnf, or the default.

Thus, the changes I want you to make are the following:

  • table_cache = 1024
  • key_buffer_size = 16M
    • thread_cache_size = 8
    • query_cache_size = 24M

Reboot America

Offline silentfreak

  • Junior Phone Loser
  • **
  • Posts: 28
  • 1337 13V3L: +1/-7
Ok I'll do that now.

Also I converted the tables to InnoDB as so:
Code: [Select]
ALTER TABLE smf_attachments
TYPE=InnoDB;
ALTER TABLE smf_collapsed_categories
TYPE=InnoDB;
ALTER TABLE smf_log_actions
TYPE=InnoDB;
ALTER TABLE smf_log_boards
TYPE=InnoDB;
ALTER TABLE smf_log_errors
TYPE=InnoDB;
ALTER TABLE smf_log_karma
TYPE=InnoDB;
ALTER TABLE smf_log_mark_read
TYPE=InnoDB;
ALTER TABLE smf_log_online
TYPE=InnoDB;
ALTER TABLE smf_log_search
TYPE=InnoDB;
ALTER TABLE smf_log_topics
TYPE=InnoDB;
ALTER TABLE smf_members
TYPE=InnoDB;
ALTER TABLE smf_pm_recipients
TYPE=InnoDB;
ALTER TABLE smf_sessions
TYPE=InnoDB;
ALTER TABLE smf_settings
TYPE=InnoDB;
ALTER TABLE smf_topics
TYPE=InnoDB;

Offline Reverend Greed

  • PLA Guru
  • *****
  • Posts: 224
  • 1337 13V3L: +42/-7
Sounds good.  Your conversion looks pretty good to me too.
Reboot America

Offline silentfreak

  • Junior Phone Loser
  • **
  • Posts: 28
  • 1337 13V3L: +1/-7
Ok I have done everything and I can already see my site running way faster.

But in regard to the eAccelerator - my host says it's creating errors:

Quote
[7084] EACCELERATOR: PHP crashed on opline 34 of vgxb7yi8()
at /home/xxxx/domains/xxxx/public_html/twatch_include/logger.php:17
[8364] EACCELERATOR: PHP crashed on opline 34 of vgxb7yi8()
at /home/xxxx/domains/xxxx/public_html/twatch_include/logger.php:17
[8330] EACCELERATOR: PHP crashed on opline 34 of vgxb7yi8()
at /home/xxxx/domains/xxxx/public_html/twatch_include/logger.php:17
[20374] EACCELERATOR: PHP crashed on opline 34 of vgxb7yi8()

AND that the current eAccelerator version doesn't support PHP 4.4.0 (the version I have installed) yet, so he disabled it at the moment.

Offline Reverend Greed

  • PLA Guru
  • *****
  • Posts: 224
  • 1337 13V3L: +42/-7
First off, the current version of eAccelerator does support PHP 4.4.0.  Please tell your hosting provider that they are on crack, then refer them to this thread.

If you do not install it properly, you will get the errors your host quoted.

If in doubt, run:

$ locate eaccelerator.so

And delete all the eaccelerator.so files lying about.  Then, recompile eAccelerator.  Make sure you're using the correct eaccelerator.so file in the php.ini line.  If not, you will get the errors as quoted.
Reboot America

Offline HostingMatters

  • Newb
  • *
  • Posts: 1
  • 1337 13V3L: +0/-1
Mr. Reverend Greed,

My name is Stacy and I am with a web hosting company called Hosting Matters.  One of our clients as shown in this forum thread sought assistance regarding the program, eAccelerator.  This issue at hand has become extremely long-winded, so as a courtesy I took the advice of our client to review this thread.

I have to be honest in saying that I felt a little discouraged about coming to this website after reviewing what it caters to.  The information you have provided here appears to be excellent advice, but we've decided to remove it based on these two factors:

1.  It causes wierd crashes even though everything was compiled right and working as it should.

2.  When I upgraded PHP to a different version it rejected the module stating: eaccelerator version is too old and can't run on the current PHP version, download a newer version of eaccelerator (it was the newest).

And, Sir, we are not on "crack" here.  We provide service to over 1000 clients and are rated top notch in technical support.  If there is anything you wish to add here, then by all means I want to hear it.

Best Regards,

Stacy

Offline Reverend Greed

  • PLA Guru
  • *****
  • Posts: 224
  • 1337 13V3L: +42/-7
Mr. Reverend Greed,

My name is Stacy and I am with a web hosting company called Hosting Matters.  One of our clients as shown in this forum thread sought assistance regarding the program, eAccelerator.  This issue at hand has become extremely long-winded, so as a courtesy I took the advice of our client to review this thread.
Nice to meet you, Stacy.  And you did the right thing.

I have to be honest in saying that I felt a little discouraged about coming to this website after reviewing what it caters to. 

Why would you feel discouraged about coming to a site that caters to technology and the human element?

The information you have provided here appears to be excellent advice, but we've decided to remove it based on these two factors:

1.  It causes wierd crashes even though everything was compiled right and working as it should.

2.  When I upgraded PHP to a different version it rejected the module stating: eaccelerator version is too old and can't run on the current PHP version, download a newer version of eaccelerator (it was the newest).

Those errors that are being generated are commonplace.  Also, your client says you're using PHP version 4.4.0!  I mean, geez, welcome to 2005.  The most current PHP version is 5.2.4.

Also, you are a hosting provider who offers Fantastico which in turns supplies forum software.  And in this case, SMF.  Therefore, having eAccelerator with content-caching for your customers should be mandatory.

Follow these steps:

1)  Upgrade PHP to 5.2.4.  http://www.php.net
2)  Install eAccelerator in this fashion: 

$ wget http://YOURMIRROR.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.5.2.tar.gz
$ tar xvzf eaccelerator-0.9.5.2.tar.gz
$ cd eaccelerator-0.9.5.2
$ /usr/bin/phpize
$ ./configure --enable-eaccelerator=shared --with-eaccelerator-content-caching --with-php-config=/usr/bin/php-config
$ make
$ su
$ mkdir /tmp/eaccelerator
$ chown apache:apache-group /tmp/eaccelerator
$ chmod 1700 /tmp/eaccelerator
$ make install

After that, you need to add a line to php.ini for it to load this extension.  Typically, the line will look like this:

zend_extension=/path/to/eaccelerator.so

When you have it installed, run:

$ php -v

...and tell me what it says.

It SHOULD show the version of eAccelerator along with the PHP version.  After restarting Apache, you should see an immediate (although, depending on your server, perhaps not hugely noticeable) improvement in load times for your clients websites.
Reboot America

Offline mr_doc

  • Supergluer of coins
  • PLA Junkie
  • *****
  • Posts: 801
  • 1337 13V3L: +71/-24
    • PLA LotGD
ps Stacy, show us your boobs.
PLAlotgd  -If you play, I will hate you a little less.
Unnamed Forums

Offline Zazen

  • Cactus Zombie
  • *****
  • Posts: 380
  • 1337 13V3L: +34/-14
And, Sir, we are not on "crack" here.

Glad you could clear that up for us

Offline mr_doc

  • Supergluer of coins
  • PLA Junkie
  • *****
  • Posts: 801
  • 1337 13V3L: +71/-24
    • PLA LotGD
Here is the HostingMatters 'most popular plan' as advertised on their homepage.
Quote
HostingMatters:
$11/mo
 550 Megabytes of space
  30 Gigabytes of transfer
  Host up to 15 domains
  40 POP3 email accounts
  6 MySQL databases

And here is godaddy.com's 'deluxe' plan, not even the cheapest one:
Quote
Godaddy
$6.99/mo
• 100 GB Space
• 1,000 GB Transfer
• 1,000 Email Accounts
• Unlimited Web sites
• FREE! Software
• 25 MySQL Databases
• Unlimited Email Forwards
• Forums, Blogging, Photo Galleries
• Metropolis Hosting Community
• $25 Google® AdWords® Credit1
• $50 Microsoft® adCenter Credit†

Ps- godaddy has current versions of php and mysql available
PLAlotgd  -If you play, I will hate you a little less.
Unnamed Forums

Offline murd0c

  • PLA Public Relations
  • Administrator
  • Ninja Phone Loser
  • *****
  • Posts: 1344
  • 1337 13V3L: +169/-74
    • murd0c dot net
Here is the HostingMatters 'most popular plan' as advertised on their homepage.
Quote
HostingMatters:
$11/mo
 550 Megabytes of space
  30 Gigabytes of transfer
  Host up to 15 domains
  40 POP3 email accounts
  6 MySQL databases

And here is godaddy.com's 'deluxe' plan, not even the cheapest one:
Quote
Godaddy
$6.99/mo
• 100 GB Space
• 1,000 GB Transfer
• 1,000 Email Accounts
• Unlimited Web sites
• FREE! Software
• 25 MySQL Databases
• Unlimited Email Forwards
• Forums, Blogging, Photo Galleries
• Metropolis Hosting Community
• $25 Google® AdWords® Credit1
• $50 Microsoft® adCenter Credit†

Ps- godaddy has current versions of php and mysql available

I fucking love you, mr doc.