CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Pre-installation Questions (Moderator: Dave Greenberg) »
  • 1000 event registrations in 5 minutes, possible?
Pages: [1]

Author Topic: 1000 event registrations in 5 minutes, possible?  (Read 3666 times)

desert_rider

  • Guest
1000 event registrations in 5 minutes, possible?
May 22, 2008, 11:28:02 pm
Hi,

I'm completely new to CiviCRM and I'm considering it for a student event that we run every year. The event is extremely popular with 1000+ registrations selling out in under 5 minutes. Yes, I'm serious.

This level of popularity has caused a number of problems over the years including mistakes in database data as multiple delegates were given the same unique identifier and then overwrote each other's data (!). In another year they maxed out the server they chose (it was a shared host, what did they expect?).

Anyway, this year I'm going to be running the event registration and I'd prefer it if some of these problems didn't happen again! :)

I've been looking at CiviCRM and it's a great system, truly brilliant. I'm very impressed with it's potential for what we are trying to do.

However, I'm interested to hear from a person with a lot of experience with CiviCRM how they think it'll go. This year we'll be using a dedicated server. Not all dedicated servers are made the same, but we'll do our best to make sure it's adequately spec'd.

The concern I have is that CiviCRM might fail under the strain. Is there any chance that CiviCRM will corrupt the data under that kind of pressure? Will it be able to handle 1000+ users at once? It would be a disaster if the data was corrupted!

I'll be very interested to hear your thoughts,

If we go with CiviCRM and it's successful I'll report back for the community to promote and others to consider.

Thankyou for your help,
Matt

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: 1000 event registrations in 5 minutes, possible?
May 23, 2008, 05:05:08 am
Hey,

I'm also very curious about what are people's experience with this.

Generally, with decent hardware, it should be fine - at worst, some people could experience smaller and larger lags in getting confirmation page. However, if I started guessing, I would say that it might be difficult: 1000 registrations in 5 minutes means that in peak time it might hit even 50 or more registration attempts per second, and this is pretty hard for any system.

Would you have appropriate knowledge/ability to write a test case (using SimpleTest) for this? There is a lot of optimisation going on these days, if we had some reliable input about this spot in the code, we could try and look at this as well in case there were any problems.

Not promising that we'll make such efficiency possible (if it's not), but we could at least identify weak spots (if any) and let you know what you should be aware of (if whatever). :-)

Thx,
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: 1000 event registrations in 5 minutes, possible?
May 23, 2008, 09:10:38 am
I would suggest doing a stress test using the expected registration pages on the actual hardware once you have it set up to see if it can handle that load.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

desert_rider

  • Guest
Re: 1000 event registrations in 5 minutes, possible?
June 04, 2008, 05:47:36 am
thanks for the responses, i must admit I'm a self taught programmer but I managed to write some basic code with simpletest.

Code: [Select]
<?php
require_once('simpletest/autorun.php');
require_once(
'simpletest/web_tester.php');

      
//database logon
      
$host = "localhost";
      
$username = "root";
      
$password = "root";
      
$database = "simpletest_data";

      
//connect to database
      
mysql_connect($host, $username, $password);
      @
mysql_select_db($database) or die("Database does not exist!");

      
//get the insertion data from the table - at the moment I'm only trying to insert one variable from the same row as where id = 1
      
$query = "select * from data where id = '1'";
      
$resultSet = mysql_query($query);
      
$result = mysql_fetch_array($resultSet);
      
$email = $result['email'];

class 
TestSite extends WebTestCase {
    function 
DoTestSite() {
        
$this->get('http://localhost:8888/d5/index.php?q=civicrm/event/info&reset=1&id=6');
$this->clickLink('Register Now!!!!');
        
$this->setField('email-5', $email );
        
$this->click('Continue >>');
    }
}
?>

However, I can't seem to get the $email variable to be inserted into the table. SimpleTest doesn't report any errors, but it's also not inserting anything.
If I change
Code: [Select]
        $this->setField('email-5', $email );
to

Code: [Select]
        $this->setField('email-5', '$email' );
the entry into CiviCRM that is entered is $email (not the variable but those 6 exact characters) when it should be the value of $email which is set from the database. It's getting the value of $email from the database because I've printed $email to make sure of it. I hope you can follow that :)

Any ideas where I might be going wrong?

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: 1000 event registrations in 5 minutes, possible?
June 04, 2008, 06:07:47 am
Is SimpleTest executing your testcase at all? From what I remember, it testcase method's name needs to start with 'test' prefix: try changing DoTestSite() to testTestSite() and run the testcase. Another guess is that code which provides $email variable's contents doesn't execute when you run the test - it's defined in global scope, while it should be probably defined somewhere in setUp() method.

Thx,
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

desert_rider

  • Guest
Re: 1000 event registrations in 5 minutes, possible?
June 04, 2008, 06:25:12 am
hmmm, I should have checked that by making those more 'friendly' to read they still actually worked. The old 'non-friendly' name did have 'test' at the start but it didn't look as nice.

I whacked 'test' in front of the above as you rightly point out to make it work. But as before, it isn't picking up the variable that I'm setting for $email.

I will investigate the setUp() and get back to you.

Cheers

desert_rider

  • Guest
Re: 1000 event registrations in 5 minutes, possible?
June 04, 2008, 08:25:01 am
I couldn't get the setUp() to work but by placing the database queries into the actual test function they are now returning the variable.

the next step is to be able to run the test a thousand times with values sourced from a thousand rows in the database. You'll see the use of WHILE($r < 6) below but it only runs the SimpleTest queries once and doesn't repeat them (5 times).

Strangely, if I refresh the script it will collect the next row each time I refresh until I have collected all of the rows in the data table or hit the maximum number set in the WHILE($r < 6) (ie 5 refreshes will result in the first 5 rows from the data table being inserted into CiviCRM).

CiviCRM won't allow the same email address to be used for two different registrations so it's almost as if SimpleTest is getting the error and by using the $r++; SimpleTest sources the next row in the data table. If however CiviCRM accepts the email address, SimpleTest stops.

SimpleTest doesn't show any failures in either case.

Thanks for your assistance!


Code: [Select]
<?php
require_once('simpletest/autorun.php');
require_once(
'simpletest/web_tester.php');

class 
TestSite extends WebTestCase {

    function 
testTestSite() {

//database logon
$host = "localhost";
$username = "root";
$password = "root";
$database = "simpletest_data";

//connect to database
mysql_connect($host, $username, $password);
@mysql_select_db($database) or die("Database does not exist!");

//set the row to get data from in the table
$r=1;
WHILE($r < 6){

//get the insertion data from the table
$query = "select * from data where id = $r";
$resultSet = mysql_query($query);
$result = mysql_fetch_array($resultSet);
$email = $result['email'];

//navigate to and insert the data into the form
        
$this->get('http://localhost:8888/d5/index.php?q=civicrm/event/info&reset=1&id=6');
$this->clickLink('Register Now!!!!');
        
$this->setField('email-5', $email);
        
$this->click('Continue >>');

//increment $r by 1 to get next row's data
$r++;
}

    }

}
?>
« Last Edit: June 04, 2008, 08:38:01 am by desert_rider »

desert_rider

  • Guest
Re: 1000 event registrations in 5 minutes, possible?
June 04, 2008, 06:03:57 pm
I worked out the issue, I had to use $browser instead of $this

I ran the code and it returned 876 entries in exactly 11 minutes (1.3 entries/sec). This was done on a MacBook Pro, 1.83GHz, 2GB RAM, running MAMP 1.7.1 with XCache enabled. SimpleTest 1.0.1 and CiviCRM 2.0.2 both installed locally. The limitation is my CPU which is maxing out for the entire test.

The test code is below. However, I found it was stopping (with no error) after about 250 entries so I made 5 different scripts, with $r set in each one to process one of 1-199, 200-399, 400-599, 600-799 and 800-899 and then set all the scripts off at once. Not sure why combined they only processed 876 as none of the 5 scripts stopped (with no error as described above), but for the purposes of testing the speed of CiviCRM it makes little difference.

Now to test again with a more detailed registration page. I'll advise of the results I get.

BTW, is there a more efficient way of laying out the below script to reduce CPU load? I'm sure there is!

Feedback welcome!

Cheers

Code: [Select]
<?php
require_once('simpletest/autorun.php');
require_once(
'simpletest/web_tester.php');


class 
TestSite extends WebTestCase {


    function 
testTestSite() {

//database logon
$host = "localhost";
$username = "root";
$password = "root";
$database = "simpletest_data";

//connect to database
mysql_connect($host, $username, $password);
@mysql_select_db($database) or die("Database does not exist!");

//set the row to get data from in the table
$r=1;
WHILE($r < 1000){

//get the insertion data from the table
$query = "select * from data where id = $r";
$resultSet = mysql_query($query);
$result = mysql_fetch_array($resultSet);
$email = $result['email'];

//navigate to and insert the data into the form
        
$browser = &new SimpleBrowser();
        
$browser->get('http://localhost:8888/d5/index.php?q=civicrm/event/info&reset=1&id=6');
$browser->clickLink('Register Now!!!!');
        
$browser->setField('email-5', $email);
        
$browser->click('Continue >>');


//increment $r by 1 to get next row's data
$r++ ;
}

    }

}
?>

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Pre-installation Questions (Moderator: Dave Greenberg) »
  • 1000 event registrations in 5 minutes, possible?

This forum was archived on 2017-11-26.