Hey guys.
I am currently trying to improve the performance of an Apache Mahout Recommender, that I am working on. Due to the fact that my users' preferences are stored in a MYSQL database, I am using the following code in order to produce recommendations:

        MysqlDataSource dataSource = new MysqlDataSource();
        dataSource.setServerName("localhost");
        dataSource.setUser("user");
        dataSource.setPassword("user_pass");
        dataSource.setDatabaseName("user_history_DB");
        dataSource.setCachePreparedStatements(true);
        dataSource.setCachePrepStmts(true);
        dataSource.setCacheResultSetMetadata(true);
        dataSource.setAlwaysSendSetIsolation(false);
        dataSource.setElideSetAutoCommits(true);

        JDBCDataModel dataModel = new MySQLJDBCDataModel(dataSource,
                "user_preferences", "user_id", "item_id", "preference",
                "timestamp");

            UserSimilarity userSimilarity =
                new PearsonCorrelationSimilarity(dataModel);

            UserNeighborhood neighborhood =
new NearestNUserNeighborhood(3, userSimilarity, dataModel);

            Recommender recommender =
new GenericUserBasedRecommender(dataModel, neighborhood, userSimilarity);

Recommender cachingRecommender = new CachingRecommender(recommender);

            List<RecommendedItem> recommendations =
                    cachingRecommender.recommend(1234, 10);

Also, I have to inform you that I have used Indexes on the database table, on both user_id and item_id to increase performance. Moreover, I have applied the following configuration settings for the MySQL server (they are mentioned in the MYSQLJDBCDataModel documentation):

 * innodb_buffer_pool_size=64M
 * myisam_sort_buffer_size=64M
 * query_cache_limit=64M
 * query_cache_min_res_unit=512K
 * query_cache_type=1
 * query_cache_size=64M

Finally, I am using Netbeans 7.1 and the project is a standard java application. Unfortunately, the performance is very bad. What can I do in order to improve performance? Am I missing something here?

Thank you,
Nick Katsipoulakis.

Reply via email to