Informative articles on various technologies ...

Different size user pictures (avatars) in different pages

A while back, we need to do display different sized user pictures (avatars) in Drupal 5.x on a client site. They wanted the user picture on the user profile page to be 100x100 pixels, but be displayed only as 65x65 on blog comments.

This is fairly easily achieved by creating this function in template.php. This function creates 65x65 size images from the original 100x100, and takes an argument of size so either can be used in different places.

Can a Drupal web site handle a million page views a day?

A question that is often asked in Drupal circles, is how much can a Drupal site scale to, and what is the hardware necessary to make it do that. The answers often go on tangents, with some advocating multiple web boxes, with a reverse proxy in front of them, and multiple master/slave MySQL boxes too, like we have on Drupal.org.

The real answer is : it depends ...

Depends on what? Many things, like:

Using ApacheBench for benchmarking logged in users - an automated approach

A recent blog post by Ezra Gildesgame on benchmarking Drupal got me rolling with some code laying around for ages. The instructions provided in the aforementioned article do indeed work, but there has to be a better way for automating benchmarking of Drupal removing the repetitive or manual steps needed.

Adding Sponsored results to Drupal's search results page

In many search engines, Google included, some results are put at the top as "sponsored links". These are put there by Google on behalf of companies that pay to have their links at the top. Google and other search ethically minded engines highlight those results in a different color and add a "Sponsored" title to those results, in order to differentiate them from normal results.

For a client's Drupal site, they wanted to do the same: add some sponsored links from a third party search site affiliated with the original site.

How to create a block with images in rotation

A client needed a simple solution to put several images in rotation, so that a random image will appear on every page load. The images are just a bunch of JPEGs or GIFs in a directory, not image nodes using the image module.

If you need to take out some images from rotation, then remove them from the directory. If you need to have more images in rotation, then just add new images to the directory. 

Displaying a predefined stock portfolio to anonymous users

The Drupal stock module enables users to save a portfolio and have it displayed in a page.

This facility is not available for anonymous users, but there is an easy workaround for this.

If you want the portfolio to be displayed in a block in the side bar, then do the following:

1. Create a block, set its input format to PHP.

2. Insert the following code in it:

Slow MySQL queries on a multi-server setup: use compression

A few months ago, we saw something strange at a client. They were facing slow cache queries, such as the following ones.

2507.25 1 cache_get SELECT data, created, headers, expire FROM cache_menu WHERE cid = '1:en'
1303.68 1 cache_get SELECT data, created, headers, expire FROM cache WHERE cid = 'content_type_info' 

They are running MySQL on a separate box from the one that has PHP running. Running the same SQL locally on the MySQL box did not show the same slow performance as running it from the PHP box.

Drupal as a web applications framework: Should Drupal target mainly developers?

For us at 2bits.com, Drupal has always been, first and foremost, a web applications framework, that happens to have some 'out of the box' features that also make it a content management framework (CMF), and a content management system (CMS).

To restrict Drupal as only a social networking CMS is not giving Drupal credit for everything else it can do. From multimedia, ecommerce, stock and currency applications, and much much more.

Pages

Is your Drupal or Backdrop CMS site slow?
Is it suffering from server resources shortages?
Is it experiencing outages?
Contact us for Drupal or Backdrop CMS Performance Optimization and Tuning Consulting