website optimizing

0 views
Skip to first unread message

Kadir Avci

unread,
Nov 24, 2009, 4:05:02 AM11/24/09
to DotNetDe...@googlegroups.com
Hello. I have an e-commerce web project. But this website is very slow now.
How can I optimize it?
Its opening time is 16sec. To long.
But my other websites are good. Max opening time is 5.68 sec. But this website I don't know why time is to long. They all use same webconfig.
Here is my webconfig file.
http://pastebin.com/m7022555a


Kadir Avcı
Software Developer | Freelance Web Designer
web: www.kad1r.com
twt: www.twitter.com/kad1r
Sent from Izmir, 35, Turkey

Processor Devil

unread,
Nov 24, 2009, 5:35:38 AM11/24/09
to dotnetde...@googlegroups.com
I would say that you have a too much large files in the layout or you simply use sql querying method that is well known as "pig coding", that means you use too much database queries on one page...

2009/11/24 Kadir Avci <avci...@gmail.com>

Jamie Fraser

unread,
Nov 24, 2009, 6:30:47 AM11/24/09
to dotnetde...@googlegroups.com
Care to elaborate on some technical details of your site?

.NET version
Using anything like NHibernate? Or ADO.Net?
What version of SQL are you using?
How big is  your DB?
Have you debugged your code to find out what is slow?
Tried using a profiler?

Kadir Avci

unread,
Nov 24, 2009, 6:36:16 AM11/24/09
to dotnetde...@googlegroups.com
I'm using ADO.Net and SQL Server 2005.
I found a problem as I told. Its stored procedure.
It takes 20sec. Now I'm trying to optimize it.



Kadir Avcı
Software Developer | Freelance Web Designer
web: www.kad1r.com
twt: www.twitter.com/kad1r
Sent from Izmir, 35, Turkey

Kadir Avci

unread,
Nov 24, 2009, 5:39:17 AM11/24/09
to dotnetde...@googlegroups.com
Yes, I found a problem. Which is my sql procedure.
Here is the procedure. I will change it but I don't know how can I write it different.

ALTER PROCEDURE [dbo].[get_AVMWeb_Items_byAnaSayfa]
    @durum nvarchar(50),
    @urunSay nvarchar(50)
AS
BEGIN
    DECLARE @sqlStr nvarchar(4000);

    set @sqlStr = 'Select top  ' + @urunSay + '  AVMWeb_Items.*, ' +
            '(select top 1 deger from AVMWeb_Item_Resources where AVMWeb_Item_Resources.itemID = AVMWeb_Items.id) as deger, ' +
            '(select top 1 deger2 from AVMWeb_Item_Resources where AVMWeb_Item_Resources.itemID = AVMWeb_Items.id) as deger2, ' +
            'AVMWeb_ItemBrands.id as MarkaID, ' +
            'AVMWeb_ItemBrands.brandname, ' +
            'AVMWeb_ItemSubCategorys.id as AltKatID, ' +
            'AVMWeb_ItemSubCategorys.subcatname ' +
            'from    AVMWeb_Items, AVMWeb_ItemBrands, AVMWeb_ItemSubCategorys ' +
            'where    AVMWeb_ItemBrands.id = AVMWeb_Items.brandID and ' +
            'AVMWeb_ItemSubCategorys.id = AVMWeb_Items.subcatID and ' +
            'AVMWeb_Items.durumanasayfaurun = ''' + @durum + ''' and ' +
            'AVMWeb_Items.durum = ''' + @durum + ''' ' +
            'order by NEWID()';
    exec (@sqlStr)
END



Kadir Avcı
Software Developer | Freelance Web Designer
web: www.kad1r.com
twt: www.twitter.com/kad1r
Sent from Izmir, 35, Turkey

Roberto Cruz Falcón

unread,
Nov 24, 2009, 5:43:52 AM11/24/09
to dotnetde...@googlegroups.com

Hi Kadir

 

                You can see the addon YSlow for Firebug – Mozilla Firefox, http://developer.yahoo.com/yslow/.

 

“YSlow analyzes web pages and suggests ways to improve their performance based on a set of rules for high performance web pages

 

Kind regards

Roberto

Raghupathi Kamuni

unread,
Nov 24, 2009, 7:24:19 AM11/24/09
to dotnetde...@googlegroups.com

Use Left Outer JOIN for joining tables

AVMWeb_Items
AVMWeb_Item_Resources

INNER JOIN for joining tables
AVMWeb_Items
AVMWeb_ItemBrands
AVMWeb_ItemSubCategorys

exec sp_executeSQL and pass the two parameters

Raghupathi Kamuni

unread,
Nov 24, 2009, 7:26:24 AM11/24/09
to dotnetde...@googlegroups.com
Also create appropriate indexes on the columns used in JOIN

Kadir Avci

unread,
Nov 24, 2009, 8:46:49 AM11/24/09
to dotnetde...@googlegroups.com
Ok I did it. Thanks. Now the website speed is 7 sec.
Thank you.



Kadir Avcı
Software Developer | Freelance Web Designer
web: www.kad1r.com
twt: www.twitter.com/kad1r


Reply all
Reply to author
Forward
0 new messages