OK, thanks.

I have implemented a simple task version of my old utilities class to run the 
sends, but I did not know that about EOF being single threaded or the single db 
connection.  I will look at the ERXTaskObjectStoreCoordinatorPool.

BIG help.

I attached the query results and the show variables result

"TABLE_SCHEMA","TABLE_NAME","TABLE_ROWS","SIZE_IN_MB","DATA_SIZE_IN_MB","INDEX_SIZE_IN_MB"
"apns","app_dev_not_type",195693,29.98437500,13.54687500,16.43750000
"apns","device_notification",339498,24.45312500,24.45312500,0.00000000
"apns","application_device",50555,21.57812500,10.51562500,11.06250000
"apns","notification",27,0.04687500,0.01562500,0.03125000
"apns","person",1,0.03125000,0.01562500,0.01562500
"apns","eo_pk_table",4,0.03125000,0.01562500,0.01562500
"apns","push_application",1,0.03125000,0.01562500,0.01562500
"apns","notification_type",5,0.03125000,0.01562500,0.01562500
"apns","_dbupdater",1,0.01562500,0.01562500,0.00000000
"apns","user_type",2,0.01562500,0.01562500,0.00000000
"information_schema","VIEWS",NULL,0.00097656,0.00000000,0.00097656
"information_schema","TRIGGERS",NULL,0.00097656,0.00000000,0.00097656
"information_schema","COLUMNS",NULL,0.00097656,0.00000000,0.00097656
"information_schema","ROUTINES",NULL,0.00097656,0.00000000,0.00097656
"information_schema","COLUMN_PRIVILEGES",NULL,0.00000000,0.00000000,0.00000000
"information_schema","SCHEMATA",NULL,0.00000000,0.00000000,0.00000000
"information_schema","TABLE_CONSTRAINTS",NULL,0.00000000,0.00000000,0.00000000
"information_schema","CHARACTER_SETS",NULL,0.00000000,0.00000000,0.00000000
"information_schema","KEY_COLUMN_USAGE",NULL,0.00000000,0.00000000,0.00000000
"information_schema","SCHEMA_PRIVILEGES",NULL,0.00000000,0.00000000,0.00000000
"information_schema","TABLE_PRIVILEGES",NULL,0.00000000,0.00000000,0.00000000
"information_schema","COLLATIONS",NULL,0.00000000,0.00000000,0.00000000
"information_schema","PROFILING",NULL,0.00000000,0.00000000,0.00000000
"information_schema","STATISTICS",NULL,0.00000000,0.00000000,0.00000000
"information_schema","COLLATION_CHARACTER_SET_APPLICABILITY",NULL,0.00000000,0.00000000,0.00000000
"information_schema","TABLES",NULL,0.00000000,0.00000000,0.00000000
"information_schema","USER_PRIVILEGES",NULL,0.00000000,0.00000000,0.00000000
"Variable_name","Value"
"auto_increment_increment",1
"auto_increment_offset",1
"automatic_sp_privileges","ON"
"back_log",50
"basedir","/usr/"
"bdb_cache_size",8384512
"bdb_home","/var/lib/mysql/"
"bdb_log_buffer_size",262144
"bdb_logdir",""
"bdb_max_lock",10000
"bdb_shared_data","OFF"
"bdb_tmpdir","/tmp/"
"binlog_cache_size",32768
"bulk_insert_buffer_size",8388608
"character_set_client","latin1"
"character_set_connection","latin1"
"character_set_database","latin1"
"character_set_filesystem","binary"
"character_set_results","latin1"
"character_set_server","latin1"
"character_set_system","utf8"
"character_sets_dir","/usr/share/mysql/charsets/"
"collation_connection","latin1_swedish_ci"
"collation_database","latin1_swedish_ci"
"collation_server","latin1_swedish_ci"
"completion_type",0
"concurrent_insert",1
"connect_timeout",10
"datadir","/var/lib/mysql/"
"date_format","%Y-%m-%d"
"datetime_format","%Y-%m-%d %H:%i:%s"
"default_week_format",0
"delay_key_write","ON"
"delayed_insert_limit",100
"delayed_insert_timeout",300
"delayed_queue_size",1000
"div_precision_increment",4
"keep_files_on_create","OFF"
"engine_condition_pushdown","OFF"
"expire_logs_days",0
"flush","OFF"
"flush_time",0
"ft_boolean_syntax","+ -><()~*:\"\"&|"
"ft_max_word_len",84
"ft_min_word_len",4
"ft_query_expansion_limit",20
"ft_stopword_file","(built-in)"
"group_concat_max_len",1024
"have_archive","NO"
"have_bdb","YES"
"have_blackhole_engine","NO"
"have_compress","YES"
"have_community_features","NO"
"have_profiling","NO"
"have_crypt","YES"
"have_csv","NO"
"have_dynamic_loading","YES"
"have_example_engine","NO"
"have_federated_engine","NO"
"have_geometry","YES"
"have_innodb","YES"
"have_isam","NO"
"have_merge_engine","YES"
"have_ndbcluster","DISABLED"
"have_openssl","DISABLED"
"have_ssl","DISABLED"
"have_query_cache","YES"
"have_raid","NO"
"have_rtree_keys","YES"
"have_symlink","DISABLED"
"hostname","revere.politico.com"
"init_connect",""
"init_file",""
"init_slave",""
"innodb_additional_mem_pool_size",1048576
"innodb_autoextend_increment",8
"innodb_buffer_pool_awe_mem_mb",0
"innodb_buffer_pool_size",134217728
"innodb_checksums","ON"
"innodb_commit_concurrency",0
"innodb_concurrency_tickets",500
"innodb_data_file_path","ibdata1:10M:autoextend"
"innodb_data_home_dir",""
"innodb_adaptive_hash_index","ON"
"innodb_doublewrite","ON"
"innodb_fast_shutdown",1
"innodb_file_io_threads",4
"innodb_file_per_table","ON"
"innodb_flush_log_at_trx_commit",1
"innodb_flush_method",""
"innodb_force_recovery",0
"innodb_lock_wait_timeout",50
"innodb_locks_unsafe_for_binlog","OFF"
"innodb_log_arch_dir",""
"innodb_log_archive","OFF"
"innodb_log_buffer_size",1048576
"innodb_log_file_size",5242880
"innodb_log_files_in_group",2
"innodb_log_group_home_dir","./"
"innodb_max_dirty_pages_pct",90
"innodb_max_purge_lag",0
"innodb_mirrored_log_groups",1
"innodb_open_files",300
"innodb_rollback_on_timeout","OFF"
"innodb_support_xa","ON"
"innodb_sync_spin_loops",20
"innodb_table_locks","ON"
"innodb_thread_concurrency",8
"innodb_thread_sleep_delay",10000
"innodb_use_legacy_cardinality_algorithm","ON"
"interactive_timeout",28800
"join_buffer_size",131072
"key_buffer_size",8384512
"key_cache_age_threshold",300
"key_cache_block_size",1024
"key_cache_division_limit",100
"language","/usr/share/mysql/english/"
"large_files_support","ON"
"large_page_size",0
"large_pages","OFF"
"lc_time_names","en_US"
"license","GPL"
"local_infile","ON"
"locked_in_memory","OFF"
"log","OFF"
"log_bin","OFF"
"log_bin_trust_function_creators","OFF"
"log_error",""
"log_queries_not_using_indexes","ON"
"log_slave_updates","OFF"
"log_slow_queries","ON"
"log_warnings",1
"long_query_time",10
"low_priority_updates","OFF"
"lower_case_file_system","OFF"
"lower_case_table_names",1
"max_allowed_packet",1048576
"max_binlog_cache_size",18446744073709547520
"max_binlog_size",1073741824
"max_connect_errors",10
"max_connections",100
"max_delayed_threads",20
"max_error_count",64
"max_heap_table_size",268435456
"max_insert_delayed_threads",20
"max_join_size",18446744073709551615
"max_length_for_sort_data",1024
"max_prepared_stmt_count",16382
"max_relay_log_size",0
"max_seeks_for_key",18446744073709551615
"max_sort_length",1024
"max_sp_recursion_depth",0
"max_tmp_tables",32
"max_user_connections",0
"max_write_lock_count",18446744073709551615
"multi_range_count",256
"myisam_data_pointer_size",6
"myisam_max_sort_file_size",9223372036853727232
"myisam_recover_options","OFF"
"myisam_repair_threads",1
"myisam_sort_buffer_size",8388608
"myisam_stats_method","nulls_unequal"
"ndb_autoincrement_prefetch_sz",1
"ndb_force_send","ON"
"ndb_use_exact_count","ON"
"ndb_use_transactions","ON"
"ndb_cache_check_time",0
"ndb_connectstring",""
"net_buffer_length",16384
"net_read_timeout",30
"net_retry_count",10
"net_write_timeout",60
"new","OFF"
"old_passwords","ON"
"open_files_limit",1024
"optimizer_prune_level",1
"optimizer_search_depth",62
"pid_file","/var/run/mysqld/mysqld.pid"
"plugin_dir",""
"port",3306
"preload_buffer_size",32768
"protocol_version",10
"query_alloc_block_size",8192
"query_cache_limit",1048576
"query_cache_min_res_unit",4096
"query_cache_size",0
"query_cache_type","ON"
"query_cache_wlock_invalidate","OFF"
"query_prealloc_size",8192
"range_alloc_block_size",4096
"read_buffer_size",131072
"read_only","OFF"
"read_rnd_buffer_size",262144
"relay_log",""
"relay_log_index",""
"relay_log_info_file","relay-log.info"
"relay_log_purge","ON"
"relay_log_space_limit",0
"rpl_recovery_rank",0
"secure_auth","OFF"
"secure_file_priv",""
"server_id",0
"skip_external_locking","ON"
"skip_networking","OFF"
"skip_show_database","OFF"
"slave_compressed_protocol","OFF"
"slave_load_tmpdir","/tmp/"
"slave_net_timeout",3600
"slave_skip_errors","OFF"
"slave_transaction_retries",10
"slow_launch_time",2
"socket","/var/lib/mysql/mysql.sock"
"sort_buffer_size",10485760
"sql_big_selects","ON"
"sql_mode",""
"sql_notes","ON"
"sql_warnings","OFF"
"ssl_ca",""
"ssl_capath",""
"ssl_cert",""
"ssl_cipher",""
"ssl_key",""
"storage_engine","InnoDB"
"sync_binlog",0
"sync_frm","ON"
"system_time_zone","EDT"
"table_cache",256
"table_lock_wait_timeout",50
"table_type","InnoDB"
"thread_cache_size",0
"thread_stack",262144
"time_format","%H:%i:%s"
"time_zone","SYSTEM"
"timed_mutexes","OFF"
"tmp_table_size",268435456
"tmpdir","/tmp/"
"transaction_alloc_block_size",8192
"transaction_prealloc_size",4096
"tx_isolation","REPEATABLE-READ"
"updatable_views_with_limit","YES"
"version","5.0.84-log"
"version_bdb","Sleepycat Software: Berkeley DB 4.1.24: (July  7, 2009)"
"version_comment","Source distribution"
"version_compile_machine","x86_64"
"version_compile_os","redhat-linux-gnu"
"wait_timeout",28800

Attachment: my.cnf
Description: application/applefile

Attachment: apns schema.sql
Description: Binary data


Note, based on Pascal's suggestion we have bumped the memory on MySQL, but it 
is not reflected yet, and won't be until we restart it at 3:30 AM.  Hopefully 
there won't be any major breaking news at that time.



On Jul 29, 2011, at 2:56 PM, Kieran Kelleher wrote:

> Andrew,
> 
> Hi Andrew,
> 
> Just to endorse what some have said, after reading this thread:
> 
> 1) concurrency must be ON
> 2) For your 1 minute task do it in a background thread and use a different 
> OSC. Remember EOF is a single-threaded, single-db-connection stack. If you 
> want high concurrency performance, you cannot just use the default OSC. Use a 
> ERXTaskObjectStoreCoordinatorPool just for tasks, even if it is just a pool 
> of one.
> 
> Also, if I get a few minutes later or at the weekend, I can eyeball your 
> setup for possible low-hanging fruit if you send the following:
> 
> A) Send your /etc/my.cnf file to the list, and tell me how much total max 
> memory you want mysql to have - I will take a quick look at it to see if it 
> looks OK.
> 
> B) send the output of the following SQL statement in a text file:
> select TABLE_SCHEMA, TABLE_NAME, TABLE_ROWS, (DATA_LENGTH + 
> INDEX_LENGTH)/1024/1024 as SIZE_IN_MB, DATA_LENGTH/1024/1024 as 
> DATA_SIZE_IN_MB, INDEX_LENGTH/1024/1024 as INDEX_SIZE_IN_MB from 
> information_schema.TABLES order by SIZE_IN_MB desc;
> 
> C) send the output of the following SQL statement in a text file:
> SHOW VARIABLES;
> 
> D) Send the output (allschemas.sql) of the following CLI statement:
> mysqldump --all-databases --opt --no-data > allschemas.sql
> 
> 
> 
> 
> 
> 
> 
> On Jul 29, 2011, at 10:56 AM, Andrew Kinnie wrote:
> 
>> That will help, thanks!
>> 
>> On Jul 29, 2011, at 10:55 AM, Alexis Tual wrote:
>> 
>>> An example of all that John said is available there thanks to Kieran :
>>> 
>>> https://github.com/projectwonder/wonder/tree/master/Examples/Misc/BackgroundTasks
>>> 
>>> Alex
>>> 
>>> Le 29 juil. 2011 à 16:52, Andrew Kinnie a écrit :
>>> 
>>>> Thanks.  I may give that a try.  That was one of the other options I 
>>>> thought of, but was hoping to avoid a significant re-write.
>>>> 
>>>> 
>>>> 
>>>> On Jul 29, 2011, at 10:44 AM, John & Kim Larson wrote:
>>>> 
>>>>> rather than increasing worker threads, why not just spawn a new Java 
>>>>> thread for sending the notifications?  That thread can run in the 
>>>>> background while you're doing EO stuff and free your app up to do the 
>>>>> servicing of requests. 
>>>>> 
>>>>> If you go down this path, I always pass EOs to other threads as globalIDs 
>>>>> to prevent problems. Also, make sure you don't lock the OSC for the app 
>>>>> during your work or your app will hang while other threads' ECs wait to 
>>>>> get it. If this gets bad enough, use a separate OSC stack and dispose of 
>>>>> it when your done.  
>>>>> 
>>>>> John 
>>>>> 
>>>>> Sent from my iPhone
>>>>> 
>>>>> On Jul 29, 2011, at 9:28 AM, Andrew Kinnie <[email protected]> wrote:
>>>>> 
>>>>>> Greetings
>>>>>> 
>>>>>> I have a deployed app which serves as a push notification server for our 
>>>>>> iOS app.  It uses a recent ERRest (post WOWODC) to provide access to the 
>>>>>> data which is located on a MySQL database (using innoDB).  The model has 
>>>>>> entities for PushApplication (the iOS app), ApplicationDevice (i.e. an 
>>>>>> iOS device which has our iOS app), Notification and has a lookup table 
>>>>>> for NotificationType (5 rows).  Notification is a message, and there is 
>>>>>> a many to many with ApplicationDevice along with a corresponding 
>>>>>> device_notification table, as well as ApplicationDeviceNotificationType 
>>>>>> to allow particular devices to have particular types of notifications 
>>>>>> turned on or off.
>>>>>> 
>>>>>> Our app in connected to by our editorial staff via a Cold Fusion app to 
>>>>>> send out breaking news alerts as push notifications.  I then get (via a 
>>>>>> fetch) all the devices which have that particular notification type 
>>>>>> (basically 90% of our 20,000+ "installed" applicationDevices), then I 
>>>>>> pass that array into a method which makes the connection to Apple and 
>>>>>> iterates through the array sending one notification to each device in 
>>>>>> turn, then closes the connection.
>>>>>> 
>>>>>> It takes approximately 1 minute to send an alert to all 20,000 devices.
>>>>>> 
>>>>>> While this happens, some of these devices are getting the push from 
>>>>>> Apple (which is crazy fast about it), and some of them are running the 
>>>>>> app and the iOS app itself is querying the server for details about the 
>>>>>> notification and loading it in.  However, if this happens while the push 
>>>>>> is still in the process of sending (i.e. within the 1 minute time 
>>>>>> frame), the iOS app may be forced to wait for the send process to finish 
>>>>>> (as many as 60 seconds presumably.  It doesn't happen all that often, 
>>>>>> because our app doesn't buzz or makes a sound when it receives a 
>>>>>> notification, but it is not ideal.  We anticipate using this same app 
>>>>>> and server for the Android version, and for the upcoming iPhone update, 
>>>>>> so the number of installed devices could increase pretty dramatically.  
>>>>>> Currently it is iPad only.
>>>>>> 
>>>>>> So, we're trying to figure out what to do about it.  Currently the app 
>>>>>> is deployed on a CentOS server (single core processor) which also houses 
>>>>>> the db, but nothing else.  It has 16 GB of RAM.
>>>>>> 
>>>>>> We were considering:
>>>>>> 
>>>>>> 1. Trying to increase the threads the app can create, but I'm not sure 
>>>>>> that would fix it as much as mask it
>>>>>> 2. Trying to run an additional copy of the app to send while the other 
>>>>>> one handles the incoming client requests, but I am not sure how to 
>>>>>> accomplish this other than copying the whole project, renaming it, then 
>>>>>> deploying that.  I am also not sure this would fix anything if in fact 
>>>>>> the issue were locking in the database or jdbc or something of that 
>>>>>> nature.
>>>>>> 3. Seeing if there was something easier, more efficient and less kludgy 
>>>>>> feeling than either of those.  (assuming either of those would work 
>>>>>> anyway, we have some difficulty testing it without sending out 20,000 
>>>>>> push notifications)
>>>>>> 
>>>>>> Anyone have any insight?
>>>>>> 
>>>>>> Andrew
>>>>>> _______________________________________________
>>>>>> Do not post admin requests to the list. They will be ignored.
>>>>>> Webobjects-dev mailing list      ([email protected])
>>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>> http://lists.apple.com/mailman/options/webobjects-dev/the_larsons%40mac.com
>>>>>> 
>>>>>> This email sent to [email protected]
>>>> 
>>>> _______________________________________________
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Webobjects-dev mailing list      ([email protected])
>>>> Help/Unsubscribe/Update your Subscription:
>>>> http://lists.apple.com/mailman/options/webobjects-dev/alexis.tual%40gmail.com
>>>> 
>>>> This email sent to [email protected]
>>> 
>> 
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list      ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/webobjects-dev/kelleherk%40gmail.com
>> 
>> This email sent to [email protected]
> 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to