How to make engine faster

10 replies
Hi guys, looking for programming help. Please can someone view and give me suggestions on how to make my search engine faster? seems to be a bit slow showing results please view here: rooah.com

thanks in advance.
#engine #faster #make
  • Profile picture of the author cgimaster
    Looking from the outside of it would be hard to give you any real advice, however consider the following:

    1) hosting location and plan, yes.

    1.1) If your hosting is on a bad server shared with many sites on overselling it may give you a poor performance.

    1.2) If your hosting server have a bad connectivity and/or link to your networking or a target set of network as in not having good exit links to a given region resulting in more hops to reach it, it will also give you a poor performance

    1.3) Verify how many users you have will also help you in case your hosting limit your website resources

    2) Test your own code counting the execution time, that can simple be done by saving when it started and when it ended then (end-start) = time taken to execute

    2.1) This would help you nailing down if your code is having the issue or not

    2.2) Also try to test it at different interval of times such as when the server or your site is less used by users and when it is most used so you can have an average between the 2.

    3) Review your own code to see what can be improved

    4) If you are using MySQL or other database engine, review your queries, see if you have slow queries, see if you have properly indexes setup.

    4.1) Index will most likely improve the query performance in most cases

    4.2) Some queries may take longer to run and can be simplified for performance

    4.3) Test your queries on the console or direct on the database or using a 3rd party tool to verify how long they take to execute

    5) Check your content, if youre are loading data from other websites that may slow down your own site like, javascript or ajax content.

    6) Use of CDN for static content to improve delivery to your users in a faster manner

    These are some points I would recommend you checking.
    {{ DiscussionBoard.errors[7047253].message }}
    • Profile picture of the author nigarachi
      Thanks guys, responses are great and very helpful. i just got back and haven't had a chance to respond yet. apologies. i really think the days are getting shorter. i will post responses to everyone, i really... extremely appreciate the help. thanks.
      {{ DiscussionBoard.errors[7069716].message }}
  • Profile picture of the author ripsnorta2
    It seemed fairly responsive when I tried a simple search.

    The search engine database would be the biggest bottlenet.

    Are you using a SQL db like MySQL or Postgres? If so, depending on how much search data you want to store, I would strongly consider looking at something else, perhaps one of the NoSQL databases. Remember Google stores petabytes of data in multiple large data centers.

    I have heard/read that Google uses a NoSQL or similar, but proprietary database.

    After the DB, make sure the application is scaleable and doesn't need to store any state other than the session.

    Optimisation is not about guessing. If I had a dollar for each time where the slow code was not what I thought it would be...

    Find yourself a profiling tool and use it to find the performance bottlenecks rather than relying on intuition.
    {{ DiscussionBoard.errors[7052027].message }}
    • Profile picture of the author cgimaster
      Google also uses MySQL and PostgreeSQL in several of their operation keep that in mind.
      {{ DiscussionBoard.errors[7056489].message }}
      • Profile picture of the author mojojuju
        Originally Posted by cgimaster View Post

        Google also uses MySQL and PostgreeSQL in several of their operation keep that in mind.
        Sure, they may use those databases for - something. That doesn't mean they directy query MySQL or Postgresql for live searches.
        Signature

        :)

        {{ DiscussionBoard.errors[7057378].message }}
        • Profile picture of the author cgimaster
          Originally Posted by mojojuju View Post

          Sure, they may use those databases for - something. That doesn't mean they directy query MySQL or Postgresql for live searches.
          Never said they use it on the google search portion of their domain, said they also use MySQL in some of their operations for example their adwords system use to use MySQL, I won't say they still use because I dont keep track of this sort of thing, but I did see an interview where they went into specific of omse of their domains etc.

          You can also use their own cloud SQL service at developers.google.com/cloud-sql/
          {{ DiscussionBoard.errors[7057431].message }}
          • Profile picture of the author ripsnorta2
            Originally Posted by cgimaster View Post

            You can also use their own cloud SQL service at developers.google.com/cloud-sql/
            Check the terms, they may not like competing search engines. And if you can host on a Google cloud, consider that you are hosting your software on a competitors service. Think G are all nice and ethical?

            For scalable hosting Amazon EC2 is an option.

            If you are developing using Python, Rails, Node.js the Heroku is good for scalability. It just doesn't support PHP yet.
            {{ DiscussionBoard.errors[7059048].message }}
            • Profile picture of the author cgimaster
              Originally Posted by ripsnorta2 View Post

              Check the terms, they may not like competing search engines. And if you can host on a Google cloud, consider that you are hosting your software on a competitors service. Think G are all nice and ethical?
              By their TOS that does not matter to them, not only that but they also have a set of dev guides on using python with their cloud SQL and encourage people to.

              I also know a few companies using it for search engine so I assume its pretty safe to use.
              {{ DiscussionBoard.errors[7059429].message }}
  • Profile picture of the author klickgablow
    Cgimaster covers a lot of good points worthy of investigation.

    Your host is going to be a primary factor in performance, so if you're running on a shared hosting environment then before we've begun to look at your code efficiency - we've got problems!

    A VPS/Dedicated hosting solution is highly recommended or you can investigate the many cloud-like offerings that exist in the market place today. Amazon, Heruko, etc.

    CDN? Yeah that too.

    Profiling your code is going to be extremely important to identify bottlenecks in queries and or classes, methods and functions. It would be useful to learn more about what languages you are using from scripting, to database and to possibly see some non-proprietary database queries or profiling reports to help you further.

    You should consider caching certain queries and results to avoid unnecessary calls to your database. Some thought needs to be invested in how to implement caching in your instance since you're running a search engine, the very nature of what you provide is dynamic. But still, caching can providing significant savings around the board.
    {{ DiscussionBoard.errors[7057267].message }}
  • Profile picture of the author ripsnorta2
    From the horses mouth: Google Research Publication: BigTable

    An excellent, really really excellent write up on bigtable is here on StackOverflow (What database does Google use? - Stack Overflow) The article here covers a lot of detail on what BigTable is and some of how it works.

    It's important to note that Google built BigTable from the ground up, and you won't be able to get a copy of it yourself. I guess it contains a lot of their secret sauce.

    These are the features it supports:
    • fast and extremely large-scale DBMS
    • a sparse, distributed multi-dimensional sorted map, sharing characteristics of both row-oriented and column-oriented databases.
    • designed to scale into the petabyte range
    • it works across hundreds or thousands of machines
    • it is easy to add more machines to the system and automatically start taking advantage of those resources without any reconfiguration
    • each table has multiple dimensions (one of which is a field for time, allowing versioning)
    • tables are optimized for GFS (Google File System) by being split into multiple tablets - segments of the table as split along a row chosen such that the tablet will be ~200 megabytes in size.
    Check the StackOverflow post out (if you're a programmer you should be living here) and if you are in for some more mind-stretching, here is the BigTable whitepaper research, all 14 PDF pages of gorgeous exposition: http://research.google.com/archive/bigtable-osdi06.pdf

    Now all this means that for you will need to change your traditional SQL DBMS for something much more scalable. Old and busted, new and Improved.

    While BigTable isn't really in the NoSQL area (I think, I deal mostly with SQL DBs anyway because I don't have the data requirements that something like a search engine needs) careful research should provide a suitable NoSQL alternative.
    {{ DiscussionBoard.errors[7059025].message }}

Trending Topics