Slow Page Loads

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
Yes, your details page is fast now.

Only the "New products" page is still slow.
13 years ago
Yes, the recently added products page uses the same stored procedure. Basically it does a SELECT TOP x FROM products ORDER BY CreatedOn DESC using that stored procedure....argh!

I have replaced the code in ProductManager.cs as follows (old code is commented out):

       /// <summary>
        /// Gets a recently added products list
        /// </summary>
        /// <param name="number">Number of products to load</param>
        /// <returns>Recently added products</returns>
        public static List<Product> GetRecentlyAddedProducts(int number)
        {
            var context = ObjectContextHelper.CurrentObjectContext;
            var query = (from p in context.Products
                        where (!p.Deleted && p.Published)
                        orderby p.CreatedOn descending
                        select p).Take(number);

            var products = query.ToList();
            return products;

            /*
            int totalRecords = 0;
            var products = ProductManager.GetAllProducts(0,
                0, 0, null, null, null, 0, string.Empty, false, number,
                0, null, NopContext.Current.WorkingLanguage.LanguageId,
                ProductSortingEnum.CreatedOn, out totalRecords);
            return products;
             */
        }

I have also altered the featured products on category, and featured products on manufacturer, in Category.cs and Manufacturer.cs. These are the only occurances I can find where its used in the public site and paging is not used. Where paging is used I will have to improve the stored procedure.

Category.cs

       /// <summary>
        /// Gets the featured products of the category
        /// </summary>
        public List<Product> FeaturedProducts
        {
            get
            {
                /*
                int totalFeaturedRecords = 0;
                var featuredProducts = ProductManager.GetAllProducts(this.CategoryId,
                    0, 0, true, int.MaxValue - 1, 0, out totalFeaturedRecords);
                */
                var featuredProducts = ProductManager.GetFeaturedProductsForCategory(this.CategoryId);

                return featuredProducts;
            }
        }

Manufacturer.cs

       /// <summary>
        /// Gets the featured products of the manufacturer
        /// </summary>
        public List<Product> FeaturedProducts
        {
            get
            {
                /*
                int totalFeaturedRecords = 0;
                var featuredProducts = ProductManager.GetAllProducts(0,
                    this.ManufacturerId, 0, true, int.MaxValue - 1, 0, out totalFeaturedRecords);
                 */
                var featuredProducts = ProductManager.GetFeaturedProductsForManufacturer(this.ManufacturerId);
                return featuredProducts;
            }
        }

ProductManager.cs

       /// <summary>
        /// Get all the featured products for a given category
        /// </summary>
        /// <param name="categoryId"></param>
        /// <returns></returns>
        public static List<Product> GetFeaturedProductsForCategory(int categoryId)
        {
            var context = ObjectContextHelper.CurrentObjectContext;
            var query = from p in context.Products
                        join pc in context.ProductCategories on p.ProductId equals pc.ProductId
                        where pc.CategoryId == categoryId &&
                        (!p.Deleted && p.Published) &&
                        pc.IsFeaturedProduct == true
                        orderby pc.DisplayOrder
                        select p;

            var products = query.ToList();
            return products;
        }

        /// <summary>
        /// Get all the featured products for a given manufacturer
        /// </summary>
        /// <param name="ManufacturerId"></param>
        /// <returns></returns>
        public static List<Product> GetFeaturedProductsForManufacturer(int manufacturerId)
        {
            var context = ObjectContextHelper.CurrentObjectContext;
            var query = from p in context.Products
                        join pm in context.ProductManufacturers on p.ProductId equals pm.ProductId
                        where pm.ManufacturerId == manufacturerId &&
                        (!p.Deleted && p.Published) &&
                        pm.IsFeaturedProduct == true
                        orderby pm.DisplayOrder
                        select p;

            var products = query.ToList();
            return products;
        }

        #endregion

        #region Product variants

Please note: all code I am posting while I have tested, I am not liable for any problems that you may have with it - anybody using this code should check that it meets their own requirements and test it out fully themselves.
13 years ago
I have developed one nopCommerce site, and it's incredibly slow. My client is not happy and now we need another solution.

I did research to choose nopCommerce - it seems to have some good features. But this was a dealbreaker.

No one will shop at our store. I would not.
13 years ago
I'm sorry to hear that. What version are you running? How many caregories and products?
13 years ago
With regards to the IIS Application Pool first compile/start up issue - the App Warm-Up IIS module from Microsoft may help: http://www.iis.net/download/applicationwarmup.

I hope this helps,

Chris
13 years ago
Please provide me modified script of index.
I'm also facing same problam.My email id is [email protected].

Thank You
13 years ago
Hi guys,

I am also having a strange problem with very slow page loads.  

I am using V1.9 and is being hosted on 123-reg.com (considering moving before store goes live but due to separate reasons...)

Details from nop com admin sys info:

nopCommerce version:   1.90
Operating system:   Microsoft Windows NT 6.0.6001 Service Pack 1
ASP.NET info:   v4.0.30319
Is full trust level:   True

SQL is MS SQL 2008 Exact version unknown.

I currently only have 3 products in the store and pages are loading in region of 5-22 seconds and I must admin it feels much, much slower.  I wouldn't use my store, I would buy elsewhere....  

Admin pages running at the same speeds but also at times fail to load fully.  EG: just get the menu bar and a 'Done' at the bottom of Firefox.  

The really strange part is that using tools like: http://www.247webmonitoring.com (as suggested in another post to keep the session alive and stop worker process recompiling) and the quick page test loads page in 17 seconds the next in 0.565 seconds and then immediately after that 22 seconds for example.  The more I try the more random the load time seems to be.  I did initially think that it was down to the css mods and custom content I had done but switching back to default layout it makes no difference.  

Obviously due to the fact I am hosted I have no options to change or add on new features as mentioned in other posts due to the exceptional high level of customer service provided by above mentioned host (hence looking at changing!).

If it is the host then I will change in a heartbeat but I don't want to switch to find the same problem.  

Does anyone have any ideas?

Side note, same problem in Firefox, Chrome and IE7 64Bit.  My OS is Windows 7 64Bit, tried clearing caches etc all the usual contenders.  123-reg do cluster the hosting, not sure if this affects the answer?  

Thanks in advance,

Andy
13 years ago
hi andy,

I can't give specific information or any guarantees  but :

I can tell you that the first ever company I hosted an asp site with was through 123 ( the hosting was provided by their sister company - pipex )

I paid £ 210 for 1 year and my site was completely un-accessible for almost the all of it - no refund, no apology

All I can say is that I register domain names with 123-reg, and with that service I am happy :)

but purely personal opinion,

consider moving your site to an alternative host.

- hayden
13 years ago
Andy,

Cluster hosting means you shouldn't get down time if one of the servers in the cluster fails, however if badly set up it could be the reason why you are getting random response times, for example if you are not being allocated enough RAM. I have used both One and One (www.1and1.co.uk) and Web Wiz - my first nopCommerce site is with WebWiz currently - this is www.bgpaynecrafts.co.uk.

If you are 64 bit in my view you need 2GB at least to run SQL/Server and IIS and more is better (One and One recommened 6GB - I am using 3GB with Webwiz at present for my Webwiz Hyper V server (effectively a cluster from a simple point of view, i.e. while not strictly speaking a SQL cluster with quorum for example the entire server is on shared hardware).

My other thought while reading your post is that NT is OLD, what year are we in, 2000? The only experience I have had recently of NT and 2000 is the sys admins didn't have a clue to be still using it in 2010.

I have done two things to improve my site (based on 1.80) performance wise. Firstly not all the tables have indexes (they have constraints but this hasn't been backed up with an index, so quite easy to find these and fix). I have also searched for all calls to the stored proc outlined in this thread and while the stored proc is still there, it isn't called in half as many places, in fact I am only calling it when paging of the output is required, in all other cases I have created new middle tier routines using Linq.

Hope this helps you in some way. I'll be posting my indexes on shortly.

Philip Johnson
13 years ago
jsdsupport wrote:
Andy,

Cluster hosting means you shouldn't get down time if one of the servers in the cluster fails, however if badly set up it could be the reason why you are getting random response times, for example if you are not being allocated enough RAM. I have used both One and One (www.1and1.co.uk) and Web Wiz - my first nopCommerce site is with WebWiz currently - this is www.bgpaynecrafts.co.uk.


Thanks for this.  Happy with clustering (Just so you know I am a technical business analyst for a russian software firm for my day job!)  It would amaze me if someone the size of 123-reg had set up their systems wrong.  I'm not saying they haven't though.  Saying that not being allocated enough RAM would do it, especially if they are using VM instead!!!  They have 'suggested' that I consider renting a dedicated box from them so I think I see their true motivation coming through...  As a side note their dedicated boxes only come with 2Gb RAM so what does the shared hosting get with '00's if not '000's sharing a single box???  

jsdsupport wrote:

If you are 64 bit in my view you need 2GB at least to run SQL/Server and IIS and more is better (One and One recommened 6GB - I am using 3GB with Webwiz at present for my Webwiz Hyper V server (effectively a cluster from a simple point of view, i.e. while not strictly speaking a SQL cluster with quorum for example the entire server is on shared hardware).


As a side note I was actually looking at possibly moving to Webwiz,  what are they like?  Any good?  

jsdsupport wrote:

My other thought while reading your post is that NT is OLD, what year are we in, 2000? The only experience I have had recently of NT and 2000 is the sys admins didn't have a clue to be still using it in 2010.


NT 6.06.001 is Windows Server 2008 Enterprise Edition, NT just refers to the NT kernel underlying it that Microsoft developed IIRC for 'higher business reliability use'.  

jsdsupport wrote:

I have done two things to improve my site (based on 1.80) performance wise. Firstly not all the tables have indexes (they have constraints but this hasn't been backed up with an index, so quite easy to find these and fix). I have also searched for all calls to the stored proc outlined in this thread and while the stored proc is still there, it isn't called in half as many places, in fact I am only calling it when paging of the output is required, in all other cases I have created new middle tier routines using Linq.

Hope this helps you in some way. I'll be posting my indexes on shortly.


Thanks for this, I will have a look into this and if you could post your findings it would be massively helpful.  The part to me that is strange is that there are so many sites using this fantastic product and very few of them seem to suffer slow response times.    Hence my first thought is that the host is just cr*p...  

Either way thanks again and I hope everyone has a fantastic Christmas and a great new year.  


Kind regards,

Andy
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.