Firefox slows down on ads from googlesyndication,com 
Sunday, September 21, 2014, 02:57 AM - General applicable solutions, Linux
Issue:

When opening a website certain advertisements are formatted so horrible that they slow down the browser and OS to a snails pace, sometimes leading to no other option then to restart the browser or even the computer.

Solution:

Add the following in the hosts file to get rid of the problem:
127.0.0.1 pagead2.googlesyndication.com

That way the advertisements just will not load anymore, thus preventing these problems.
  |  permalink
Magento command line cron fails with invalid login 
Tuesday, April 29, 2014, 10:51 AM - Faq, Linux, SuSE, SQL, MySQL, SuSE, php, MySQL
Issue:

When running the cron shell script from Magento from the command line using a random linux user, the shell script fails with an invalid username/password login on the database.

Solution:

The caching of Magento is turned on. This causes the linux user also to build up a cache directory for the configuration in a temporary location, most likely /tmp. This is insecure (part of the problem) and should only be done on dedicated systems. Also this /tmp cache directory is never refreshed. So all old configuration stays in there and is used every time again by the command shell script. When now the database configuration is updated, for example after cloning the Magento code to a development environment, and the cron shell script was started before that update, the cache created contains the database user and password. Changing the configuration xml file does not result in rebuilding this cache in /tmp, leading to the shell script using the previous username/password for login in the database.

The solution is to remove the cache location in /tmp for this magento user on a regular basis (once per day). Removing the cache location will result in the cache being rebuild on execution of the cron shell script, thus using the correct settings.


  |  permalink
Eclipse crashes when using autocomplete 
Friday, January 17, 2014, 03:53 AM - Java, Linux, SuSE, SuSE
Issue:

Eclipse crashes all the time when using the autocomplete options. This can happen suddenly after a software update or direct after installation.
It reports about the following on crash (start eclipse from the command line to get similar logging):


No bp log location saved, using default.
[000:000] Cpu: 6.58.9, x4, 2600Mhz, 3581MB
[000:000] Computer model: Not available
[000:000] Browser XEmbed support present: 1
[000:001] Browser toolkit is Gtk2.
[000:001] Using Gtk2 toolkit
No bp log location saved, using default.
[000:000] Cpu: 6.58.9, x4, 2600Mhz, 3581MB
[000:001] Computer model: Not available
java version "1.7.0_45"
OpenJDK Runtime Environment (IcedTea 2.4.3) (suse-24.9.1-x86_64)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)



Solution:

The problem is caused by an incompatibility in SWT which reports very little in the .log file. To solve it, edit eclipse.ini and add the following line at the end of the file:

-Dorg.eclipse.swt.browser.DefaultType=mozilla


This generally solves the issue.
  |  permalink
Zentyal is showing much higher loads then might be expected 
Thursday, January 16, 2014, 01:32 AM - Linux, SQL, MySQL, MySQL
Issue:

Zentyal is showing much higher loads when processing e-mail then might be expected.

Solution:

This high load might be caused by the mysql database not having all correct indexes.
Adding these indexes might reduce the system load:



CREATE INDEX idx_m_msg_trf_hrl_nn_1 ON mail_message_traffic_hourly(vdomain,date);

CREATE INDEX idx_m_msg_trf_dal_nn_1 ON mail_message_traffic_daily(vdomain,date);

CREATE INDEX idx_m_msg_trf_mon_nn_1 ON mail_message_traffic_monthly(vdomain,date);

CREATE INDEX idx_m_msg_trf_wk_nn_1 ON mail_message_traffic_weekly(vdomain,date);



In the first environment this has been implemented MySQL CPU use dropped from 51CPU minutes/day to 2 CPU minutes/day.

  |  permalink
XEN guest boot with kernel 3.X gives storage errors 
Wednesday, October 9, 2013, 03:29 PM - Linux
Issue:

ext3/ext4 gives you very disturbing storage errors and causes a system to mount readonly once every two system restarts. Receovery mode boot with explicit fsck seems to help.


Solution:

The kernel does not correctly recognize the fact that you are using virtualized disk devices. Add barrier=0 in fstab to your ext3/4 devices. That will solve the issue.


  |  permalink
Expanding a disk in XEN 
Friday, June 21, 2013, 12:16 AM - SuSE, SuSE
Issue:

OpenSuSE allows only 4 disks in a XEN vm.

Solution:

You can fix the code when you run pout of diskspace, or you can add the diskspace by expanding the disk.

Expanding the disk is the easiest:
Shutdown the VM
Create a spare file:
dd if=/dev/zero of=somedisk.img seek=50000 bs=!M count=0
(Creates a 50G file).
Concatenate this file to the existing image:
cat somedisk.img >> youroriginaldisk.img

Start the VM and use fdisk to assign this new diskspace.


  |  permalink
No cure = no pay database optimization 
Sunday, March 24, 2013, 07:20 PM - General applicable solutions
We are now able to offer no cure = no pay database landscape optimization.

This model has been proven at a large Dutch energy company, which now saves over Euro 12.5mln/year with our landscape optimization.

We do this optimizations on a no cure = no pay basis.

Two possible structures:
We make an inventory of your database landscape and determine the possible savings. If the possible savings are significant, we make a deal for a percentage of the savings, so you do not need money out of your IT budget! This can save you up to 95% of your database landscape.

Or
When the possible savings are not expressable in monetary value, we provide you with our best service, advising you on code optimizations and a database maintenance plan.
(This can save up to 75% of database resources).

This service is provided for:
- Oracle (version 8 and higher);
- Microsoft SQL Server (version 6 and higher);
- Mysql (version 5 and higher).

Discuss the possibilities with us. Use the contact form in the right hand menu to contact us.
  |  permalink
Reindexing of magento product attributes is slow 
Sunday, March 24, 2013, 06:57 PM - Faq, SuSE, SuSE
Issue:

This issues is related to Magento 1.6.2, but might also show up in other versions.

The re-indexing of magento product attributes is getting slower with a growing number of products.
The problem can be traced back to a poorly written query:
SELECT `pid`.`entity_id`, `pid`.`attribute_id`, `pid`.`store_id`, IFNULL(pis.value, pid.value) AS `value`
FROM (SELECT `s`.`store_id`, `s`.`website_id`, `d`.`entity_id`, `d`.`attribute_id`, `d`.`value` FROM `core_store` AS `s`
LEFT JOIN `catalog_product_entity_int` AS `d` ON 1 = 1 AND d.store_id = 0 WHERE (s.store_id != 0)
) AS `pid`
LEFT JOIN `catalog_product_entity_int` AS `pis` ON pis.entity_id = pid.entity_id AND pis.attribute_id = pid.attribute_id AND pis.store_id = pid.store_id
INNER JOIN `cataloginventory_stock_status` AS `ciss` ON ciss.product_id = pid.entity_id AND ciss.website_id = pid.website_id
WHERE (pid.attribute_id IN(?)) AND (IFNULL(pis.value, pid.value) IS NOT NULL) AND (pid.entity_id IN(?)) AND (ciss.stock_status = 1);


This query contains a subquery which is first evaluated by Mysql before applying the where conditions.

Solution:

In general the re-indexing process of Magento is slow. There are some fixes available which circumvent the problem by queueing index request.
There are sometimes more direct solutions, like running better queries.
In this case fixing the query helps:
Rewriting the query to the following shape:
SELECT `d`.`entity_id`, `d`.`attribute_id`, `s`.`store_id`, IFNULL(pis.value, d.value) AS `value`
FROM `core_store` AS `s`
LEFT JOIN `catalog_product_entity_int` AS `d` ON d.store_id = 0
LEFT JOIN `catalog_product_entity_int` AS `pis` ON pis.entity_id = d.entity_id AND pis.attribute_id = d.attribute_id AND pis.store_id = s.store_id
INNER JOIN `cataloginventory_stock_status` AS `ciss` ON ciss.product_id = d.entity_id AND ciss.website_id = s.website_id
WHERE (d.attribute_id IN(?)) AND (IFNULL(pis.value, d.value) IS NOT NULL) AND (d.entity_id IN(?)) AND (ciss.stock_status = 1) AND s.store_id!=0;


helps the database to be able to apply the where statement much earlier, consuming way less system resources (In our system with >20000 products: From 20s to 0.02s per execution, reducing row evaluation from ~10mln down to 17).

The code to be fixed: Magento core file:
app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php

The fixed function:
protected function _prepareSelectIndex($entityIds = null, $attributeId = null)
{
$adapter = $this->_getWriteAdapter();
$idxTable = $this->getIdxTable();
// prepare select attributes
if (is_null($attributeId)) {
$attrIds = $this->_getIndexableAttributes(false);
} else {
$attrIds = array($attributeId);
}

if (!$attrIds) {
return $this;
}

/**@var $select Varien_Db_Select*/
$select = $adapter->select()
->from(
array('s' => $this->getTable('core/store')),
array('store_id', 'website_id')
)
->joinLeft(
array('d' => $this->getValueTable('catalog/product', 'int')),
'd.store_id=0',
array()
)
->joinLeft(
array('pis' => $this->getValueTable('catalog/product', 'int')),
'pis.entity_id = d.entity_id AND pis.attribute_id = d.attribute_id AND pis.store_id = d.store_id',
array()
)
->columns(
array(
'd.entity_id',
'd.attribute_id',
's.store_id',
'value' => $adapter->getIfNullSql('pis.value', 'd.value')
)
)
->where('d.attribute_id IN(?)', $attrIds)
->where('s.store_id!=?', 0);

$select->where(Mage::getResourceHelper('catalog')->getIsNullNotNullCondition('pis.value', 'd.value'));

if (!is_null($entityIds)) {
$select->where('d.entity_id IN(?)', $entityIds);
}

/**
* Add additional external limitation
*/
Mage::dispatchEvent('prepare_catalog_product_index_select', array(
'select' => $select,
'entity_field' => new Zend_Db_Expr('d.entity_id'),
'website_field' => new Zend_Db_Expr('s.website_id'),
'store_field' => new Zend_Db_Expr('s.store_id')
));

$query = $select->insertFromSelect($idxTable);
$adapter->query($query);

return $this;
}


Add the following indexes:

CREATE INDEX idx_catprdentint_nn_1 ON catalog_product_entity_int(entity_id, attribute_id, store_id, entity_type_id);

CREATE INDEX idx_cat_proc_ent_nn_5 ON catalog_product_entity_int(entity_id, attribute_id, store_id, value);



Test results show no visible wait time anymore on this index generation when using update on save.



  |  permalink
Speeding up magento indexing 
Sunday, March 17, 2013, 03:00 PM - Faq, SuSE
Issue:

The Magento re-indexing of Catalog URL Rewrites is slow. This is due to the very ineffective way the system is working with many deletes.

Solution:

There are 2 indexes which can speed up the process considerably. In the case as used by me, it reduced the to be processed records from ~50000 to ~100 for 1 DELETE query, and for the second delete query it removed the CPU intensive index merge with a more effective range scan. Time spend by the indexing process on this index is reduced with an estimated 95%.

The indexes to be created:

CREATE INDEX idx_core_url_rewrite_nn_3 ON core_url_rewrite(store_id,category_id);

CREATE INDEX idx_core_url_rewrite_nn_4 ON core_url_rewrite(store_id,product_id,category_id);


  |  permalink
Installing linux on Mac Mini A1176 
Saturday, October 27, 2012, 09:27 PM - Linux, SuSE
Steps:
1) Install SuSE or other linux on a harddisk using another PC.
2) Replace the harddrive with your just installed harddrive.

Start and it works.
  |  permalink
More RMAN catalog speedups 
Thursday, August 11, 2011, 07:39 AM - Oracle, Oracle
The following query can become faster by adding an index:

SELECT MAX(RSR_KEY)
FROM RSR, DBINC
WHERE DBINC.DB_KEY = :B2 AND RSR.DBINC_KEY = DBINC.DBINC_KEY AND RSR.RSR_STAMP < :B1;


The indices:

create index idx_rsr_nn_1 on rsr(dbinc_key,rsr_stamp, rsr_key);
create index idx_dbinc_nn_1 on dbinc(db_key, dbinc_key);

  |  permalink
RMAN Crosscheck performance issues 
Wednesday, August 10, 2011, 09:26 PM - Oracle
Issue:

Crosscheck is about 1 second (or more) per backup piece.

Solution:

It is possible that there are some full table scans in the query

SELECT NVL(MIN(SCN),POWER(2,64)-1)
FROM (
SELECT MIN(BRL.LOW_SCN) SCN
FROM BRL
WHERE BRL.DBINC_KEY = :B1 UNION
SELECT MIN(AL.LOW_SCN)
FROM AL
WHERE AL.DBINC_KEY = :B1 UNION
SELECT MIN(XAL.LOW_SCN)
FROM XAL
WHERE XAL.DBINC_KEY = :B1 UNION
SELECT MIN(BDF.CKP_SCN)
FROM BDF
WHERE BDF.DBINC_KEY = :B1 UNION
SELECT MIN(CDF.CKP_SCN)
FROM CDF
WHERE CDF.DBINC_KEY = :B1 UNION
SELECT MIN(XDF.CKP_SCN)
FROM XDF
WHERE XDF.DBINC_KEY = :B1 UNION
SELECT MIN(BCF.CKP_SCN)
FROM BCF
WHERE BCF.DBINC_KEY = :B1 UNION
SELECT MIN(CCF.CKP_SCN)
FROM CCF
WHERE CCF.DBINC_KEY = :B1 UNION
SELECT MIN(XCF.CKP_SCN)
FROM XCF
WHERE XCF.DBINC_KEY = :B1 );


This can be slightly improved by adding several indices:

create index idx_bcf_nn_1 on bcf(dbinc_key,ckp_scn);
create index idx_bdf_nn_1 on bdf(dbinc_key,ckp_scn);
create index idx_brl_nn_1 on brl(dbinc_key,low_scn);


If the indices are not helping, try altering db_file_multiblock_read_count to 0 (oracle 10/11 only). This can speed up the full table scans.
  |  permalink
Oracle Enterprise Manager 10g is slow in processing agent data 
Wednesday, April 6, 2011, 08:12 AM - Oracle
Issue:

There is a large back log in processing the XML uploaded by the agents. The AWR shows database related issues.

Solution:

There are several indexes which prevent some of the full table scans which speed up the processing speed considerably:
CREATE INDEX sysman.mgmt_current_metrics_idx1 ON sysman.mgmt_current_metrics (key_value,metrics_guid,target_guid);

and

CREATE INDEX sysman.mgmt_current_metrics_idx2 ON sysman.mgmt_current_metrics(target_guid, metric_guid, collection_timestamp);

Probably there are more (-:
  |  permalink
Argument list too long 
Tuesday, April 5, 2011, 03:36 PM - Linux
Issue:

Remove under unix gives an argument list too long.

Solution:

A possibility is to write a script:
TOBEREMOVED=start of file name to be removed
function larger_rm ()
{ while read line1; do
if [ $line1==$TOBEREMOVED* ]
then
if [ $line1 != $TOBEREMOVED ]
then
echo "removing "$line1
rm $line1
fi
fi
done
}
ls | larger_rm


This script removes all files except the file name itself (handy with historical files).
Warning: It is slow....
  |  permalink
OpenSuse 11.4 Xen VM fails with ATA errors 
Sunday, March 27, 2011, 06:06 PM - SuSE
Issue:

OpenSuse 11.4 Xen VM fails with ATA errors after upgrading to the desktop kernel version included in the distribution.

Solution:

Re-start the installation and install the default kernel instead of the Xen desktop kernels.


  |  permalink
XEN bridged network config SuSE 11.4 not routing correctly after restart 
Sunday, March 20, 2011, 09:23 AM - SuSE
Issue:

After a restart of the XEN kernel on OpenSuSE 11.4, DHCP of the bridged interface works, but a pint to the route returns with destination host unreachable.

Solution:

The eth interface used to communicate with the outside world is dropped out of the bridged configuration for unknown reasons. Use brctl add br0 eth0 to add the interface (and of course replace br0 and eth0 with your own values).
  |  permalink
Oracle Enterprise manager is slow in uploading metrics data 
Thursday, November 18, 2010, 10:54 AM - Oracle, Oracle
Issue:

Oracle Enterprise Manager has a large backlog of to be processed XML files.

Solution:

The problem can be that the stored procedure EMD_LOADER.UPDATE_CURRENT_METRICS is slow due to an not efficient index on the table SYSMAN.MGMT_CURRENT_METRICS. The index SYSMAN.MGMT_CURRENT_METRICS_PK is in the incorrect order to be efficient. Add the following index:
CREATE INDEX "SYSMAN"."MGMT_CURRENT_METRICS_IDX1_EFFICIENT" ON "SYSMAN"."MGMT_CURRENT_METRICS" ("KEY_VALUE", "METRIC_GUID", "TARGET_GUID");


  |  permalink
Formatting a file for use in KVM/qemu 
Sunday, September 12, 2010, 07:50 PM - General applicable solutions
Issue:

Your installed kvm virtual machine has run out of disk space and the volume created with qemu-img can not be formatted by Microsoft Windows (XP SP3).

Solution:

Create an image:
qemu-img create -f raw edrive.img 64G
Use fdisk (under linux) to create a disk header in the image:
fdisk /home/kvm/edrive.img
Press w
Add the image to your config:
qemu-kvm -cdrom /home/kvm/somecd.img -hda windowsxp_install.img -hdb edrive.img -m 1024 -net nic -net user &
Now the disk can be partitioned and formatted in Microsoft Windows (XP SP3)


  |  permalink
Microsoft SQL Server Management Studio is slow while starting 
Thursday, June 24, 2010, 08:14 AM - Microsoft SQL Server, Microsoft SQL Server
Issue:

SQL Server Management Studio is slow while starting.

Solution:

The management studio can not find a certain URL. This can be fixed by adding the following line to the hosts file:
127.0.0.1 crl.microsoft.com


  |  permalink  |  related link
HTTP access_log crashes Oracle Enterprise Manager Grid Control 
Wednesday, May 12, 2010, 02:48 PM - Oracle, Oracle
Issue:

Once in a while, depending on the installation size, the apache httpd access_log grows to 2GB on the Oracle Enterprise Manager Grid Control installation.

Solution:

There are two possible solutions:
A. Correct the log rotate setup;
B. Stop the logging.
This solution is the solution to stop the logging (since it is pretty much useless anyway).
Edit the sysman/config/httpd_em.conf file and hash out the following lines:

ErrorLog /oracle/product/oms10g/Apache/Apache/logs/error_log
TransferLog "/oracle/product/oms10g/Apache/Apache/logs/access_log"


to

# ErrorLog /oracle/product/oms10g/Apache/Apache/logs/error_log
# TransferLog "/oracle/product/oms10g/Apache/Apache/logs/access_log"


Delete the old log files from Apache/Apache/logs and restart grid control. The logging should be stopped.

  |  permalink

Next