If setup incorrectly, ActiveCampaign’s import system can be incredibly slow. I put together some tips for ensuring you have the best settings possible.
Make sure you are using INNODB for a table engine instead of MyISAM. The table level locking of MyISAM can make inserts very slow on import.
Find and open your MySQL config file. On linux this is typically at /etc/my.cnf. On Windows this is typically a file in your MySQL folder named my.ini
Add a line (or update if it is there) with the following:
innodb_flush_log_at_trx_commit=0
Add a line (or update if it is there) with the following:
innodb_buffer_pool_size=1G
Set the above size to 50% of the available memory on the server. In the above we set it to “1G” for if you have 2GB available on the server. If you have 8 GB on the server you could set this to “4G”
You MUST restart MYSQL on the server for these changes to be used.
The latest version of Google Analytics has a very nice feature called “Page Speed”. You’ll see the new tab underneath the content section…
I wondered why i had no data under site speed. After some research I found that I needed to modify the GA javascript to include a directive for page speed. You’ll need to add _gaq.push(['_trackPageLoadTime']); to the inline javascript as shown here..
After you save your modified file(s), you should begin to see data within 24 hours. Google tracks a small sample of pageviews and averages them all. You’ll see a page by page breakdown of speeds and how many times that page was sampled. This is helpful for finding outliers.
Pros: Nice data over time in a GUI with 2 seconds of work. Breakdown of individual page speeds.
Cons: Using this method fires an additional request to google for a second tracking pixel. Generally you shouldn’t notice this addition.
I just had a chance to try out an incredible new plugin for Firefox called “Tilt”, which allows you to see a 3D model of any websites DOM structure. To give it a try, check out mozilla hacks website or directly download the XPI file.
Here is a screenshot of the CampusLIVE team page inside the view. Cool!
I am frequently sent large zip files of photos or videos from clients, which I need to download and then FTP to their website. I decided today to find a different way to do this so I could bypass the long process of uploading GBs of files.
1) Go to your email from YouSendIt and right click on the download button. Copy this link.
2) SSH into your server.
3) Issue the “lynx” command to open a text-based browser
A recent project of mine required that I print out a link of online stores in a random order, so that no store has more exposure at the top of the list than others. This is the solution I came up with using PHP.
<?
// all of your items to shuffle go here
$links = array('<a href="http://www.google.com">Google</a>',
'<a href="http://www.yahoo.com">Yahoo</a>',
'<a href="http://www.ebay.com">EBay</a>',
'<a href="http://www.cnn.com">CNN</a>',
'<a href="http://www.wsj.com">Wall Street Journal</a>'
);
// this shuffles up the array order
shuffle($links);
// let's create a unordered list to display the items
echo "<ul>";
// here's where all the items get printed
foreach ($links as $link) {
echo "<li>$link</li>";
}
// closing the unordered list
echo "</ul>";
?>
water or coffee
mac or pc
aol or gmail
car or bike
club or dive bar
take photo or be the photo
sit or stand
rent or buy
cook or take-out
read or watch
talk or listen
write or type
txt or call
Stereotypes aside it’s an interesting world we live in
I hate splash pages and never ever suggest using one to any of my web development clients. After all, it just delays the user from getting to what they are looking for – your content. Unfortunately sometimes you get a client that doesn’t listen to your recommendations, even when supported with tons of supporting articles against splash pages like these…
So if you’re building a website with WordPress and you have a client that despite the horrible idea, demands a splash page, I have a solution for you.
1) Edit header.php (inside your theme folder), adding this to the top
This code checks to see if the cookie “no_splash” is set. If the user hasn’t seen the splash page before, they’ll be redirected to the splash page… splash_page.php (which we create in step 2)
<?php
if(!isset($_COOKIE['no_splash'])) { // Start of the IF statement - if the user does not have a cookie that says whether he/she has visited the splash page, take them to the splash page
header('Location:http://www.yoururlhere.com/splash_page.php'); // Redirect code
} else { // But... if they do have the cookie (they have been on the splash page), just serve the page as normal
//.... do page here
}
?>
2) Create a file called splash_page.php and put it in your site root
At the top of the file we need to add the code to create the cookie, so that next time they come to the site they don’t see this horrible splash page.
<?php
$expire = time() + 60*60*24; // This means, expire in 1 day - 60 seconds * 60 minutes * 24 hours
setcookie("no_splash", "1", $expire); // This makes the cookie. It goes in this order: setcookie(cookie_name, cookie_value, expiry_time)
// Do splash page from here down....
?>
Below this code you will put your HTML for the splash page.
3) You promise to never create another useless splash page!
I have found that when running mysqlhotcopy to backup a database, it always throws an ominous looking error when finished.
DBD::mysql::db do failed: MySQL server has gone away at mysqlhotcopy line 528.
This type of error would lead you to believe the backup failed, when in actuality it worked just fine. I have restored from backups that resulted in this error just fine.
The solution to this error is to modify the system variables interactive_timeout and wait_timeout from the default settings. Inside your my.cnf file (usually located at /etc/my.cnf) put the following lines.
interactive_timeout=3600
wait_timeout=3600
You may have to adjust up for larger databases. These particular settings work for me with 15-20GB databases. Here is the result I get upon completion.
Copying 691 files...
Copying indices for 0 files...
Unlocked tables.
mysqlhotcopy copied 230 tables (691 files) in 416 seconds (417 seconds overall).
[root@mysql2 scripts]#
I ran into an issue today when our slave MySQL server was lagging behind the master. The error was that a certain table didn’t exist. I went into the master and looked for the table causing the issue. Normally there are 3 files for each database table when you’re using the MyISAM storage engine.
table_name.frm
table_name.MYD
table_name.MYI
The master machine only had 1 file
table_name.MYI
Hmmmmmm… what gives? I fired up PhpMyAdmin on the Master DB and noticed the table was using InnoDB storage instead of MyISAM. Ultimately I found this was caused by one of our devs adding a new table to the database using PhpMyAdmin, which was defaulting to InnoDB. My database backup method of choice (mysqlhotcopy) doesn’t function if any of the tables in the DB are using a different storage engine than MyISAM.
The solution: Edit you my.cnf file (typically located at /etc/my.cnf). Add the following line to set the default storage engine to MyISAM.
default-storage-engine=MYISAM
Tables already created with InnoDB will not be changed, but your “new table” dropdown in PhpMyAdmin should now show MyISAM as the default engine.